tag @s add exclude
execute if entity @s[distance=..50] unless block ~ ~ ~ #survivalplus:nobounce positioned ^ ^ ^-.4 run summon marker ~ ~ ~ {Tags:[wrangle]}
execute unless entity @s[distance=..50] if block ~ ~ ~ #survivalplus:nobounce positioned ^ ^ ^-.4 run summon marker ~ ~ ~ {Tags:[wrangle]}
execute if entity @e[dx=0,type=!#survivalplus:notalive,tag=!exclude] positioned ~-0.99 ~-0.99 ~-0.99 if entity @e[dx=0,type=!#survivalplus:notalive,tag=!exclude] positioned ~1 ~1 ~1 run summon marker ^ ^ ^-.4 {Tags:[wrangle]}
#execute at @s as @e[distance=..10,tag=ballista_stand] run effect give @s minecraft:glowing 1
execute at @s as @n[distance=..10,tag=ballista_stand] at @s run particle electric_spark ~ ~2 ~
execute at @s as @n[distance=..10,tag=ballista_stand] at @s anchored eyes facing entity @n[tag=wrangle] eyes run tp @s ~ ~ ~ ~ ~

execute if entity @s[distance=..50] if block ~ ~ ~ #survivalplus:nobounce positioned ^ ^ ^.5 run function survivalplus:tools/trap/ballista/wrangle
execute at @s if entity @e[distance=..10,tag=ballista_stand] at @e[tag=wrangle] run particle electric_spark ~ ~ ~ 0 0 0 0 1 force
kill @n[tag=wrangle]
tag @s remove exclude