execute unless entity @n[distance=..3,tag=necromancer_summon] run title @s actionbar {"color":"red", "text": "No valid summons nearby!"}
execute unless entity @n[distance=..3,tag=necromancer_summon] run playsound entity.arrow.hit_player master @s ~ ~ ~ 1 0.5
execute unless entity @n[distance=..3,tag=necromancer_summon] run give @s minecraft:bone[minecraft:custom_name='{"italic":false,"text":"[ Soul of Reclamation ]"}',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 Gravemite summon to evolve it into a Gravemite Gnawer."}]}','{"text":""}','{"color":"gray","italic":false,"text":"Upgrades:"}','{"color":"#9620b6","italic":false,"text":"[ SKILL ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"This entity gains the ability to devour corpses."}]}','{"color":"#9620b6","italic":false,"text":"[ SKILL ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"While devouring corpses, heal nearby allies every second."}]}','{"color":"#b62020","italic":false,"text":"[ ON-DEATH ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"Massively heal allies in a large radius."}]}','{"text":""}','{"color":"gray","italic":false,"text":"Existing weapons and armors will be carried over."}'],minecraft:rarity=rare,minecraft:enchantment_glint_override=true,minecraft:custom_data={necromancer_soul_of_reclamation:1b,necromancer_soul_upgrade:1b},minecraft:consumable={consume_seconds:0,animation:none,sound:"minecraft:entity.phantom.bite",has_consume_particles:false},minecraft:item_model="minecraft:ender_eye"] 1

execute if entity @n[distance=..3,tag=gravemite_evolved] run title @s actionbar {"color":"red", "text": "This summon has already evolved!"}
execute if entity @n[distance=..3,tag=gravemite_evolved] run playsound entity.arrow.hit_player master @s ~ ~ ~ 1 0.5
execute if entity @n[distance=..3,tag=gravemite_evolved] run give @s minecraft:bone[minecraft:custom_name='{"italic":false,"text":"[ Soul of Reclamation ]"}',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 Gravemite summon to evolve it into a Gravemite Gnawer."}]}','{"text":""}','{"color":"gray","italic":false,"text":"Upgrades:"}','{"color":"#9620b6","italic":false,"text":"[ SKILL ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"This entity gains the ability to devour corpses."}]}','{"color":"#9620b6","italic":false,"text":"[ SKILL ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"While devouring corpses, heal nearby allies every second."}]}','{"color":"#b62020","italic":false,"text":"[ ON-DEATH ] ","extra":[{"color":"gray","bold":false,"italic":false,"text":"Massively heal allies in a large radius."}]}','{"text":""}','{"color":"gray","italic":false,"text":"Existing weapons and armors will be carried over."}'],minecraft:rarity=rare,minecraft:enchantment_glint_override=true,minecraft:custom_data={necromancer_soul_of_reclamation:1b,necromancer_soul_upgrade:1b},minecraft:consumable={consume_seconds:0,animation:none,sound:"minecraft:entity.phantom.bite",has_consume_particles:false},minecraft:item_model="minecraft:ender_eye"] 1

tag @n[distance=..3,limit=1,type=silverfish,tag=gravemite,tag=!gravemite_evolved] add gravemite_gnawer
data merge entity @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] {CustomName:'{"text":"[ Gravemite Gnawer ]"}'}
execute as @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] at @s on passengers run tag @s add gravemite_gnawer_slime
execute as @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] at @s run particle item{item:"rotten_flesh"} ~ ~1 ~ 1 0.4 1 0.2 100 normal
execute as @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] at @s run particle minecraft:sculk_soul ~ ~1 ~ 0.5 0.8 0.5 0.2 30
execute as @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] at @s run particle item{item:"bone"} ~ ~1 ~ 0.5 0.8 0.5 0.2 100
execute as @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] at @s run playsound minecraft:entity.phantom.bite master @a[distance=..64] ~ ~ ~ 1 0
execute as @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] at @s run playsound minecraft:entity.strider.death master @a[distance=..64] ~ ~ ~ 1 0
execute as @n[distance=..3,limit=1,tag=gravemite_gnawer,tag=!gravemite_evolved] at @s run playsound minecraft:entity.fox.bite master @a[distance=..64] ~ ~ ~ 1 0
tag @n[distance=..3,limit=1,type=silverfish,tag=gravemite_gnawer] add gravemite_evolved
