execute if entity @s[tag=!snipsen] if entity @e[type=#survivalplus:sentrytarget,distance=..14] anchored eyes run tp @s ~ ~ ~ facing entity @n[type=#survivalplus:sentrytarget] eyes
execute if entity @s[tag=!snipsen] if entity @e[type=#survivalplus:sentrytarget,distance=..14] if block ~ ~-.1 ~ #survivalplus:nobounce run tp @s ~ ~-.1 ~
#execute if entity @s[tag=!snipsen] if entity @e[type=#survivalplus:sentrytarget,distance=..14] if block ~ ~-.1 ~ bubble_column[drag=false] run tp @s ~ ~.2 ~
execute if entity @s[tag=!snipsen] if entity @e[type=#survivalplus:sentrytarget,distance=..14] if score @s timer matches 0 anchored eyes run function survivalplus:tools/trap/sentrytarget

execute if entity @s[tag=snipsen] if entity @e[type=#survivalplus:sentrytarget,distance=..40] anchored eyes run tp @s ~ ~ ~ facing entity @n[type=#survivalplus:sentrytarget] eyes
execute if entity @s[tag=snipsen] if entity @e[type=#survivalplus:sentrytarget,distance=..40] if block ~ ~-.1 ~ #survivalplus:nobounce run tp @s ~ ~-.1 ~
execute if entity @s[tag=snipsen] if entity @e[type=#survivalplus:sentrytarget,distance=..40] if score @s timer matches 0 anchored eyes run function survivalplus:tools/trap/sentrytarget
execute at @e[tag=sentry,tag=!snipsen,scores={timer=1}] if entity @e[type=#survivalplus:sentrytarget,distance=..10] run playsound minecraft:entity.arrow.shoot neutral @a ~ ~ ~ .5 2
execute at @e[tag=snipsen,scores={timer=1}] if entity @e[type=#survivalplus:sentrytarget,distance=..40] run playsound minecraft:entity.generic.explode neutral @a ~ ~ ~ .5 1.5

execute unless score @s[tag=!snipsen] timer matches 1.. run scoreboard players set @s timer 30
execute unless score @s[tag=snipsen] timer matches 1.. run scoreboard players set @s timer 90
execute if entity @e[type=#survivalplus:sentrytarget,distance=..14] run scoreboard players remove @s[scores={timer=1..},tag=!snipsen] timer 1
execute if entity @e[type=#survivalplus:sentrytarget,distance=..40] run scoreboard players remove @s[scores={timer=1..},tag=snipsen] timer 1