tag @e[distance=..12,tag=ChargeStart,limit=1,tag=!GotCoordCharge,sort=random] add GetCoordCharge
tag @a remove ShootAtMeChar
tag @a[limit=1,sort=random,distance=..100,tag=CadeyrnFightTag,gamemode=!spectator] add ShootAtMeChar
tag @e[limit=1,sort=random,distance=..12,tag=ChargeStart,tag=!LaunchedCharge] add LaunchMeCharge

execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run data merge entity @s {NoAI:0}
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result score @s PosX run data get entity @s Pos[0]
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result score @s PosY run data get entity @s Pos[1]
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result score @s PosZ run data get entity @s Pos[2]

execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result score @s PosXTemp run data get entity @p[tag=ShootAtMeChar] Pos[0]
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result score @s PosYTemp run data get entity @p[tag=ShootAtMeChar] Pos[1]
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result score @s PosZTemp run data get entity @p[tag=ShootAtMeChar] Pos[2]

execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run scoreboard players operation @s PosXTemp -= @s PosX
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run scoreboard players operation @s PosYTemp -= @s PosY
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run scoreboard players operation @s PosZTemp -= @s PosZ

execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result entity @s Motion[0] double 0.08 run scoreboard players get @s PosXTemp
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result entity @s Motion[1] double 0.07 run scoreboard players get @s PosYTemp
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run execute store result entity @s Motion[2] double 0.08 run scoreboard players get @s PosZTemp
execute as @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run data merge entity @s {NoGravity:0,NoAI:0}

effect give @e[tag=ChargeStart,tag=!LaunchedCharge,tag=LaunchMeCharge] minecraft:fire_resistance 5555 0
effect give @e[tag=ChargeStart,tag=!LaunchedCharge,tag=LaunchMeCharge] minecraft:slow_falling 1 0
effect give @e[tag=ChargeStart,tag=!LaunchedCharge,tag=LaunchMeCharge] minecraft:absorption 2 3
execute at @e[tag=ChargeStart,limit=1,sort=nearest,tag=LaunchMeCharge,tag=!LaunchedCharge] run playsound minecraft:entity.player.breath hostile @a ~ ~ ~ 10 1 1
tag @e[type=armor_stand,tag=MoveSkeleStand,tag=GetCoordCharge] add GotCoordCharge
tag @e[tag=ChargeStart,tag=!LaunchedCharge,tag=LaunchMeCharge] add LaunchedCharge
tag @a remove ShootAtMeChar




