## Activated ability for mystic. Adjust animation length (cooldown) in endmo-bp/animations/player.json > animation.player.morph_mystic_activated

scoreboard players remove @s CurrentForce 10

execute positioned ^ ^0.4 ^0 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^0.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^0.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^0.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^1 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^1.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^1.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^1.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^2 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^2.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^2.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^2.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^3 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^3.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^3.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^3.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^4 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^4.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^4.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^4.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^5.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^5.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^5.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^6 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^6.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^6.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^6.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^7 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^7.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^7.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^7.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^8 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^8.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^8.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^8.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^9 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^9.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^9.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^9.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^10 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^10.6 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^10.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^10.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^11 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^11.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^11.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^11.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^12 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^12.25 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^12.5 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^12.75 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget
execute positioned ^ ^0.4 ^13 run tag @e[x=~-1,y=~-5,z=~-1,dx=2,dy=5,dz=2] add PlayerMysticTarget

stopsound @a[r=13,tag=PlayerMysticTarget] mob.ender_mystic.charge
playsound mob.ender_mystic.beam @a[r=13,tag=PlayerMysticTarget]
# tags anything in the range of the beam
tag @e[r=13,family=mob,tag=PlayerMysticTarget] add PlayerMysticDamage
tag @e[r=13,family=goat,tag=PlayerMysticTarget] add PlayerMysticDamage
tag @e[r=13,family=fish,tag=PlayerMysticTarget] add PlayerMysticDamage
tag @e[r=13,family=panda,tag=PlayerMysticTarget] add PlayerMysticDamage
tag @e[r=13,family=piglin,tag=PlayerMysticTarget] add PlayerMysticDamage
tag @e[r=13,family=monster,tag=PlayerMysticTarget] add PlayerMysticDamage
tag @e[r=13,family=ender,tag=PlayerMysticTarget] add PlayerMysticDamage
tag @e remove PlayerMysticTarget
# changes the tag to only correct family types in the beam

damage @e[r=13,type=!ldz:ender_lord,tag=PlayerMysticDamage] 19 entity_attack entity @s
damage @e[r=13,type=ldz:ender_lord,tag=PlayerMysticDamage] 12 entity_attack entity @s
tag @e remove PlayerMysticDamage
# damages mobs tagged by the beam
