tag @s add IGotLaunched
execute at @s run playsound minecraft:entity.wither_skeleton.ambient hostile @a ~ ~ ~ 11 0.5 1
execute at @e[type=armor_stand,tag=SoulSplitPortal] run tp @s ~ ~ ~ ~ ~
execute at @e[type=armor_stand,tag=SoulSplitPortal] run particle minecraft:dust 100 100 100 1 ~ ~1 ~ 0.55 1 0.55 1 50
tag @a remove ShootAtMeLeap
tag @a[limit=1,sort=random,distance=..100,tag=CadeyrnFightTag,gamemode=!spectator] add ShootAtMeLeap

execute as @s run execute store result score @s PosX run data get entity @s Pos[0]
#execute as @s run execute store result score @s PosY run data get entity @s Pos[1]
execute as @s run execute store result score @s PosZ run data get entity @s Pos[2]
#            
execute as @s run execute store result score @s PosXTemp run data get entity @p[tag=ShootAtMeLeap] Pos[0]
#execute as @s run execute store result score @s PosYTemp run data get entity @p[tag=ShootAtMeLeap] Pos[1]
execute as @s run execute store result score @s PosZTemp run data get entity @p[tag=ShootAtMeLeap] Pos[2]
#            
execute as @s run scoreboard players operation @s PosXTemp -= @s PosX
#execute as @s run scoreboard players operation @s PosYTemp -= @s PosY
execute as @s run scoreboard players operation @s PosZTemp -= @s PosZ
#       
execute as @s run data merge entity @s {Motion:[0.0,0.4,0.0]}     
execute as @s run execute store result entity @s Motion[0] double 0.02 run scoreboard players get @s PosXTemp
#execute as @s run execute store result entity @s Motion[1] double 0.04 run scoreboard players get @s PosYTemp
execute as @s run execute store result entity @s Motion[2] double 0.02 run scoreboard players get @s PosZTemp
execute as @s run data merge entity @s {NoGravity:0,NoAI:0,CustomNameVisible:1b}

effect give @s minecraft:slow_falling 1 0
effect give @s minecraft:fire_resistance 5000 0
effect give @s minecraft:absorption 2 3
#execute at @s run playsound minecraft:entity.player.breath hostile @a ~ ~ ~ 10 1 1

tag @a remove ShootAtMeLeap

