execute unless entity @n[distance=..3,tag=necromancer_summon,tag=zombie_evolved,tag=!zombie_evolved_2] run title @s actionbar {"color":"red", "text": "No valid summons nearby!"}
execute unless entity @n[distance=..3,tag=necromancer_summon,tag=zombie_evolved,tag=!zombie_evolved_2] run playsound entity.arrow.hit_player master @s ~ ~ ~ 1 0.5
execute unless entity @n[distance=..3,tag=necromancer_summon,tag=zombie_evolved,tag=!zombie_evolved_2] run give @s minecraft:bone[minecraft:custom_name='{"italic":false,"text":"[ Soul of Awakening ]"}',minecraft:lore=['{"color":"gray","italic":false,"text":"[","extra":[{"color":"dark_green","bold":false,"italic":false,"keybind":"key.use"},{"color":"gray","italic":false,"text":"] on a Ghoul summon to evolve it into a Revenant."}]}','""','{"color":"gray","italic":false,"text":"Upgrades:"}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"red","bold":false,"italic":false,"text":"+50 Health"}]}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"blue","bold":false,"italic":false,"text":"+0.1 Movement Speed"}]}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"+6 Attack Damage"}]}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"#afce9c","bold":false,"italic":false,"text":"+1 Step Height"}]}','{"color":"#2070b6","italic":false,"text":"[ ON-HIT ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"Leeches a moderate amount of health when targeted enemies are hit."}]}','{"color":"#9620b6","italic":false,"text":"[ SKILL ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"Periodically let out a vicious growl when enemies are close, dealing damage in a large radius."}]}','{"color":"dark_purple","italic":false,"text":"[ MISC ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"This entity’s armor and weapon can not be modified."}]}','""','{"color":"red","italic":false,"text":"Existing weapons and armors will not be carried over."}'],minecraft:rarity=epic,minecraft:enchantment_glint_override=true,minecraft:custom_data={necromancer_soul_of_awakening:1b,necromancer_soul_upgrade:1b},minecraft:consumable={consume_seconds:0,animation:none,sound:"minecraft:entity.hoglin.converted_to_zombified",has_consume_particles:false},minecraft:item_model="minecraft:ender_eye"] 1

execute if entity @n[distance=..3,tag=zombie_evolved_2] run title @s actionbar {"color":"red", "text": "This summon has already evolved!"}
execute if entity @n[distance=..3,tag=zombie_evolved_2] run playsound entity.arrow.hit_player master @s ~ ~ ~ 1 0.5
execute if entity @n[distance=..3,tag=zombie_evolved_2] run give @s minecraft:bone[minecraft:custom_name='{"italic":false,"text":"[ Soul of Awakening ]"}',minecraft:lore=['{"color":"gray","italic":false,"text":"[","extra":[{"color":"dark_green","bold":false,"italic":false,"keybind":"key.use"},{"color":"gray","italic":false,"text":"] on a Ghoul summon to evolve it into a Revenant."}]}','""','{"color":"gray","italic":false,"text":"Upgrades:"}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"red","bold":false,"italic":false,"text":"+50 Health"}]}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"blue","bold":false,"italic":false,"text":"+0.1 Movement Speed"}]}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"+6 Attack Damage"}]}','{"color":"#d79e2b","italic":false,"text":"[ STAT ] ","extra":[{"color":"#afce9c","bold":false,"italic":false,"text":"+1 Step Height"}]}','{"color":"#2070b6","italic":false,"text":"[ ON-HIT ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"Leeches a moderate amount of health when targeted enemies are hit."}]}','{"color":"#9620b6","italic":false,"text":"[ SKILL ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"Periodically let out a vicious growl when enemies are close, and dealing damage in a large radius."}]}','{"color":"dark_purple","italic":false,"text":"[ MISC ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"This entity’s armor and weapon can not be modified."}]}','""','{"color":"red","italic":false,"text":"Existing weapons and armors will not be carried over."}'],minecraft:rarity=epic,minecraft:enchantment_glint_override=true,minecraft:custom_data={necromancer_soul_of_awakening:1b,necromancer_soul_upgrade:1b},minecraft:consumable={consume_seconds:0,animation:none,sound:"minecraft:entity.hoglin.converted_to_zombified",has_consume_particles:false},minecraft:item_model="minecraft:ender_eye"] 1

tag @n[distance=..3,limit=1,type=zombie,tag=ghoul,tag=!zombie_evolved_2] add revenant
attribute @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] max_health modifier add necromancer_revenant_max_health 50 add_value
attribute @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] movement_speed modifier add necromancer_revenant_movement_speed 0.1 add_value
attribute @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] attack_damage modifier add necromancer_revenant_attack_damage 6 add_value
attribute @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] step_height modifier add necromancer_revenant_step_height 1 add_value
data merge entity @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] {CustomName:'{"text":"[ Revenant ]"}',ArmorItems:[{id:"minecraft:leather_boots",count:1,components:{"minecraft:dyed_color":2772265}},{id:"minecraft:leather_leggings",count:1,components:{"minecraft:dyed_color":4218423}},{id:"minecraft:leather_chestplate",count:1,components:{"minecraft:dyed_color":4095305}},{id:"minecraft:player_head",count:1,components:{"minecraft:profile":{id:[I;-544240374,1913603054,-1441701437,637128988],properties:[{name:"textures",value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZGJhZDk5ZWQzYzgyMGI3OTc4MTkwYWQwOGE5MzRhNjhkZmE5MGQ5OTg2ODI1ZGExYzk3ZjZmMjFmNDlhZDYyNiJ9fX0="}]}}}]}
effect give @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] instant_damage 3 25 true
execute as @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] at @s run particle minecraft:block_crumble{block_state:"redstone_block"} ~ ~1 ~ 0.5 0.7 0.5 1 30
execute as @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] at @s run particle minecraft:sculk_soul ~ ~1 ~ 0.5 0.8 0.5 0.2 25
execute as @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] at @s run particle minecraft:explosion ~ ~1 ~ 0.5 0.8 0.5 0.2 15
execute as @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] at @s run playsound minecraft:entity.generic.explode hostile @a[distance=..32] ~ ~ ~ 1 0.7
execute as @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] at @s run playsound minecraft:entity.ender_dragon.growl hostile @a[distance=..32] ~ ~ ~ 1 0.5
execute as @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] at @s run playsound minecraft:entity.wolf.growl hostile @a[distance=..32] ~ ~ ~ 1 0.75
execute as @n[distance=..3,limit=1,tag=revenant,tag=!zombie_evolved_2] at @s run playsound minecraft:entity.wolf.growl hostile @a[distance=..32] ~ ~ ~ 1 0.5
tag @n[distance=..3,limit=1,type=zombie,tag=revenant] add zombie_evolved_2