execute as @e[type=item,nbt={Item:{id:"minecraft:recovery_compass",components:{"minecraft:custom_data":{gravefinder:tag}}}},limit=1,sort=nearest] run tag @s add del1
execute at @e[tag=del1] as @p[distance=..2,scores={death=1..}] run tag @s add keepitem
execute at @e[tag=del1] as @p[distance=..2,scores={death=1..}] run tag @s add gravefinder
execute at @e[tag=del1] run particle minecraft:sculk_soul ~ ~1 ~ 0 0 0 0 1
execute as @e[tag=del1] run execute store result score @s itemcount run data get entity @s Item.count
execute as @e[tag=del1] if score @s itemcount matches 1 run kill @s
execute as @e[tag=del1] if score @s itemcount matches 2.. run scoreboard players remove @s itemcount 1
execute as @e[tag=del1] store result entity @s Item.count short 1 run scoreboard players get @s itemcount
execute at @e[tag=del1] run playsound minecraft:entity.allay.ambient_without_item player @a ~ ~ ~ .8 2
tag @e remove del1