scoreboard players add @e[type=stray,name="Cadeyrn the Wretched"] StartCadTimer 1
execute at @e[type=stray,scores={StartCadTimer=1}] run execute at @e[name=LavD] positioned ~50 ~7 ~1 run summon minecraft:armor_stand ~ ~ ~ {CustomName:"\"CadeyrnFight\"",NoGravity:1,Invisible:1b,Silent:1b,Silent:1b,Invulnerable:1}
execute at @e[type=stray,scores={StartCadTimer=1}] run execute at @e[name=CadeyrnFight] run tag @a[gamemode=survival,distance=..21] add CadeyrnFightStart
execute at @e[type=stray,scores={StartCadTimer=1}] run tellraw @a[distance=..50] ["",{"text":"[","color":"dark_blue"},{"text":"Cadeyrn the Wretched","color":"gold"},{"text":"] ","color":"dark_blue"},{"text":"I see. So, you wish to challenge me?","color":"dark_red"}]
execute at @e[type=stray,scores={StartCadTimer=50}] run fill ~5 13 ~5 ~-5 13 ~-5 barrier
execute at @e[type=stray,scores={StartCadTimer=50}] run fill ~-2 1 ~-2 ~2 ~3 ~2 air replace barrier
execute at @e[type=stray,scores={StartCadTimer=50}] run execute at @e[name=LavD] positioned ~50 8 ~1 run fill ~-10 ~ ~-10 ~10 ~10 ~10 air replace lava
execute at @e[type=stray,scores={StartCadTimer=90}] run execute at @e[name=CadeyrnFight] positioned ~-1 ~-1 ~ run fill ~6 7 ~10 ~-13 7 ~-12 minecraft:barrier replace air
execute at @e[type=stray,scores={StartCadTimer=50}] run execute at @e[name=LavD] positioned ~49 5 ~ run fill ~ ~ ~ ~3 ~ ~2 air destroy
execute at @e[type=stray,scores={StartCadTimer=50}] run execute at @e[name=LavD] positioned ~51 4 ~-1 run fill ~ ~ ~ ~ ~5 ~4 air destroy
execute at @e[type=stray,scores={StartCadTimer=50}] run execute at @e[name=LavD] positioned ~52 4 ~-1 run fill ~ ~ ~ ~ ~5 ~4 air destroy
execute at @e[type=stray,scores={StartCadTimer=50}] run execute at @e[name=LavD] positioned ~49 4 ~ run fill ~ ~ ~-1 ~3 ~ ~3 black_concrete
execute at @e[type=stray,scores={StartCadTimer=50}] run effect give @e[distance=..5,type=skeleton_horse] levitation 50 1
execute at @e[type=stray,scores={StartCadTimer=50..89}] run execute as @e[type=skeleton_horse,distance=..2] run execute at @s run tp @s ~-.065 ~ ~
execute at @e[type=stray,scores={StartCadTimer=10..140}] run fill ~-3 7 ~-3 ~3 7 ~3 barrier replace air
execute at @e[type=stray,scores={StartCadTimer=10..140}] run fill ~-3 ~-2 ~-3 ~3 ~2 ~3 air replace barrier
execute at @e[type=stray,scores={StartCadTimer=160}] run execute at @e[name=LavD] positioned ~50 ~7 ~1 run setblock ~ 3 ~ minecraft:structure_block[mode=load]{name:"suhc:skull",posX:-2,posZ:-3,posY:1,rotation:NONE,mirror:NONE,mode:LOAD,ignoreEntities:0b}
execute at @e[type=stray,scores={StartCadTimer=160}] run execute at @e[name=LavD] positioned ~50 ~7 ~1 run setblock ~ 2 ~ redstone_block
execute at @e[type=stray,scores={StartCadTimer=164..167}] run execute at @e[name=LavD] positioned ~50 ~7 ~1 run fill ~ 2 ~ ~ 3 ~ air
execute at @e[type=stray,scores={StartCadTimer=165}] run execute at @e[name=CadeyrnFight] run function zzzzdonotuse:cadeyrn/createarena
execute at @e[type=stray,scores={StartCadTimer=40}] run function zzzzdonotuse:cadeyrn/initialstart2
execute at @e[type=stray,scores={StartCadTimer=40..249}] run execute as @a[tag=CadeyrnFightStart] run execute at @s run tp @s ~ ~ ~ facing entity @e[type=stray,name="Cadeyrn the Wretched",limit=1]
execute at @e[type=stray,scores={StartCadTimer=250..340}] run function zzzzdonotuse:cadeyrn/suck
execute as @e[name="Cadeyrn the Wretched"] run execute at @s run tp @s ~ ~ ~ facing entity @p[distance=..20]
execute at @e[name=CadeyrnFight] positioned ~1 ~ ~ run particle minecraft:campfire_cosy_smoke ~ ~ ~ 0 0 0 0.12 10 normal
execute at @e[type=stray,scores={StartCadTimer=1}] run playsound minecraft:block.portal.trigger hostile @a[distance=..100] ~ ~ ~ 50 0.5 1
execute at @e[type=stray,scores={StartCadTimer=160..340},tag=!FightStarted] run playsound minecraft:entity.cat.purr hostile @a[distance=..25] ~ ~ ~ 90 0.1 1