scoreboard players set @s AttackTimer 0
data merge block ~ ~ ~ {auto:0b}
tag @s remove MidAttack
tag @s add PhaseTwo
scoreboard players operation @s CadeyrnBossBarHP = @s CadeyrnHalfHP
data merge entity @s {NoAI:0,NoGravity:0,Invulnerable:0,Attributes:[{Name:generic.knockback_resistance,Base:.65},{Name:generic.movement_speed,Base:.30},{Name:generic.follow_range,Base:75}]}
item replace entity @s weapon.mainhand with golden_sword{Enchantments:[{id:"minecraft:sharpness",lvl:11s},{id:"minecraft:knockback",lvl:1s},{id:"minecraft:fire_aspect",lvl:2s}]} 1
item replace entity @s armor.feet with chainmail_boots{Enchantments:[{id:"minecraft:feather_falling",lvl:20s},{id:"minecraft:blast_protection",lvl:20s},{id:"minecraft:projectile_protection",lvl:6s}]} 1
kill @e[type=skeleton_horse,tag=DiePls]
kill @e[type=skeleton,tag=DiePls]
kill @e[type=stray,tag=DiePls]
kill @e[type=armor_stand,tag=WallMove]
effect give @s fire_resistance 50000 0
#effect give @s resistance 50000 0
execute at @e[type=armor_stand,name=CadeyrnFight] positioned ~32 126 ~32 run tp @e[dx=-64,dy=30,dz=-64,type=#suhc:pigtype,tag=!CadeyrnMinion] ~ -500 ~


execute at @e[name=CadeyrnFight] run fill ~-2 133 ~-2 ~2 140 ~2 air

execute in overworld run data merge block 999990 145 999988 {auto:1b}

#activate short leap
execute at @s run execute unless entity @a[distance=..12,gamemode=!spectator] run execute at @e[type=armor_stand,name=DayQ] run data merge block 999991 158 999988 {auto:1b}
