kill @n[tag=ballista]
#kill @n[tag=balarrow]
execute as @e[type=item,tag=!plussed,nbt={Item:{id:"minecraft:leather_chestplate",components:{"minecraft:custom_data":{delballista:tag}}}}] run tag @s add ballistaegg
execute at @e[tag=ballistaegg] run kill @n[type=item,tag=!plussed,nbt={Item:{id:"minecraft:armor_stand"}},distance=..2]
execute at @e[tag=ballistaegg] run summon item ~ ~ ~ {Item:{id:skeleton_spawn_egg,components:{item_model:crossbow,custom_data:{nospawner:tag},item_name:"Ballista Sentry",lore:[{"text":"Targets hostile mobs slowly","italic":false,"color":"gray"},{"text":"Place to setup","italic":false,"color":"gray"},{"text":"Requires supporting block","italic":false,"color":"red"}],entity_data:{id:armor_stand,CustomName:"Ballista Sentry",NoGravity:1b,Pose:{Head:[180f,0f,0f],LeftArm:[272f,91f,0f],RightArm:[270f,270f,0f]},ShowArms:1b,DisabledSlots:4144959,Tags:[ballista_stand,trap,special,balsetup,reloading],equipment:{chest:{id:leather_chestplate,components:{trim:{material:gold,pattern:bolt},custom_data:{del:tag,delballista:tag}}},legs:{id:leather_leggings,components:{trim:{material:copper,pattern:bolt},custom_data:{del:tag}}},feet:{id:leather_boots,components:{trim:{material:gold,pattern:bolt},custom_data:{del:tag}}},mainhand:{id:spyglass,components:{custom_data:{del:tag}}},offhand:{id:spyglass,components:{custom_data:{del:tag}}}},drop_chances:{feet:2f,legs:0f,chest:0f,head:0f,mainhand:0f}}}}}
tag @e remove ballistaegg
execute as @e[type=item,tag=!plussed,nbt={Item:{components:{"minecraft:custom_data":{delsentry:tag}}}}] run kill @s