execute positioned ~ ~1.55 ~ as @n[tag=ballista] at @s run function survivalplus:tools/trap/ballista/face
execute if entity @s[tag=reloading] run function survivalplus:tools/trap/ballista/reload
execute if score @s timer matches 70 if entity @e[type=#survivalplus:sentrytarget,distance=..30] anchored eyes facing entity @n[type=#survivalplus:sentrytarget,distance=..30] eyes positioned ^ ^-.1 ^.5 rotated as @s positioned ^ ^ ^5 facing entity @s eyes facing ^ ^ ^-1 positioned as @s run tp @s ~ ~ ~ ~ ~-1
execute if score @s timer matches 70 anchored eyes run function survivalplus:tools/trap/ballista/aim
scoreboard players add @s[scores={timer=..69},tag=reloading] timer 1
execute if block ~ ~-.1 ~ #survivalplus:notrap run function survivalplus:tools/trap/ballista/failed