execute at @s run execute as @a[tag=ShootSoulAtMe] run execute as @s run execute store result score @s UUIDKyu run data get entity @s UUID[0]

scoreboard players operation @a[tag=ShootSoulAtMe] UUIDKyu -= @s UUIDKyu
execute at @s[tag=!DoSteal,tag=!DoDestroy] run tp @s ^ ^ ^ facing entity @p[scores={UUIDKyu=1}] eyes
execute at @s[tag=!DoSteal,tag=!DoDestroy] run tp @s ^ ^ ^ facing entity @p[scores={UUIDKyu=-1}] eyes


execute at @s[tag=!DoSteal,tag=!DoDestroy] run tp @s ^ ^ ^.15
execute at @s run execute if entity @a[gamemode=!spectator,distance=..2] run tag @s add DoSteal
execute at @s run execute unless block ~ ~ ~ air run tag @s add DoDestroy
execute at @s positioned ^ ^.85 ^-3.5 run particle minecraft:item dark_prismarine ~ ~ ~ 0 0 0 0.1 10

execute at @s[tag=!DoSteal,tag=!DoDestroy] run tp @s ^ ^ ^.15
execute at @s run execute if entity @a[gamemode=!spectator,distance=..2] run tag @s add DoSteal
execute at @s run execute unless block ~ ~ ~ air run tag @s add DoDestroy
execute at @s positioned ^ ^.85 ^-3.5 run particle minecraft:item dark_prismarine ~ ~ ~ 0 0 0 0.1 10

execute at @s[tag=!DoSteal,tag=!DoDestroy] run tp @s ^ ^ ^.15
execute at @s run execute if entity @a[gamemode=!spectator,distance=..2] run tag @s add DoSteal
execute at @s run execute unless block ~ ~ ~ air run tag @s add DoDestroy
execute at @s positioned ^ ^.85 ^-3.5 run particle minecraft:item dark_prismarine ~ ~ ~ 0 0 0 0.1 10

execute at @s[tag=!DoSteal,tag=!DoDestroy] run tp @s ^ ^ ^.15
execute at @s run execute if entity @a[gamemode=!spectator,distance=..2] run tag @s add DoSteal
execute at @s run execute unless block ~ ~ ~ air run tag @s add DoDestroy
execute at @s positioned ^ ^.85 ^-3.5 run particle minecraft:item dark_prismarine ~ ~ ~ 0 0 0 0.1 10

execute at @s[tag=!DoSteal,tag=!DoDestroy] run tp @s ^ ^ ^.15
execute at @s run execute if entity @a[gamemode=!spectator,distance=..2] run tag @s add DoSteal
execute at @s run execute unless block ~ ~ ~ air run tag @s add DoDestroy
execute at @s positioned ^ ^.85 ^-3.5 run particle minecraft:item dark_prismarine ~ ~ ~ 0 0 0 0.1 10



#execute at @s run playsound minecraft:entity.ghast.hurt hostile @a[distance=..100] ~ ~ ~ 1 1.5 1
execute at @s[tag=DoSteal,tag=!DoDestroy] run effect give @p[distance=..2] minecraft:instant_damage 1 0
execute at @s[tag=DoSteal,tag=!DoDestroy] run tag @p[distance=..2] add StealMySoul
execute as @s[tag=DoSteal,tag=!DoDestroy] run function zzzzdonotuse:cadeyrn/attacks/soulsteal/takesoul
execute at @s[tag=DoDestroy] run function zzzzdonotuse:cadeyrn/attacks/soulsteal/destroyblock
kill @s[tag=DoDestroy]
kill @s[tag=DoSteal]