setblock 999991 137 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/changelocation/changelocationmain",TrackOutput:0} destroy
setblock 999991 138 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/autoattack/autoattackmain",TrackOutput:0} destroy
setblock 999991 139 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/basicfireball/basicfireballmain",TrackOutput:0} destroy
setblock 999991 140 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/bonethrow/bonethrowmain",TrackOutput:0} destroy
setblock 999991 141 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/brigade/brigademain",TrackOutput:0} destroy
setblock 999991 142 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/chargeslash/chargeattackmain",TrackOutput:0} destroy
setblock 999991 143 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/firesheet/firesheetmain",TrackOutput:0} destroy
setblock 999991 144 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/skelefrombone/skeletonfrombonemain",TrackOutput:0} destroy
setblock 999991 145 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/soulsteal/soulstealmain",TrackOutput:0} destroy

#setblock 999991 157 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/phasetransition/phasetransitionmain",TrackOutput:0} destroy

setblock 999990 143 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/maintimer",TrackOutput:0} destroy
setblock 999990 144 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/phasetransition/phasetransitionmain",TrackOutput:0} destroy
setblock 999990 145 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/maintimerphase2",TrackOutput:0} destroy
setblock 999990 146 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,tag=LightningCad] run function zzzzdonotuse:cadeyrn/attacks/entitycharge/lightningboltstandmove",TrackOutput:0} destroy
setblock 999990 147 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/resetaggrotimer",TrackOutput:0} destroy



setblock 999991 146 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/arrowvolley/arrowvolleymain",TrackOutput:0} destroy
setblock 999991 147 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/entitycharge/entitychargemain",TrackOutput:0} destroy
setblock 999991 148 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/entitycharge/4minionstimer",TrackOutput:0} destroy
setblock 999991 149 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/fallingeffect/fallingeffectmain",TrackOutput:0} destroy
setblock 999991 150 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/firecircle/fireswirl",TrackOutput:0} destroy
setblock 999991 151 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/fireline/firelinemain",TrackOutput:0} destroy
setblock 999991 152 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/firelinemassive/firelinemassivemain",TrackOutput:0} destroy
setblock 999991 153 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/firewhip/firewhipmain",TrackOutput:0} destroy
setblock 999991 154 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/getoverhere/getoverheremain",TrackOutput:0} destroy
setblock 999991 155 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/groundcrack/groundcrackmain",TrackOutput:0} destroy
setblock 999991 156 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/p2chargeslash/p2chargeslashmain",TrackOutput:0} destroy
setblock 999991 157 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/pocketsand/pocketsandmain",TrackOutput:0} destroy
setblock 999991 158 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/shortleap/shortleapmain",TrackOutput:0} destroy
setblock 999991 159 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/soulsplit/soulsplitmain",TrackOutput:0} destroy
setblock 999991 160 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/summonindolent/summonindolentmain",TrackOutput:0} destroy
setblock 999991 161 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/teleport/teleportmain",TrackOutput:0} destroy
setblock 999991 162 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/tinyexplode/tinyexplodemain",TrackOutput:0} destroy
setblock 999991 163 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/vineattack/vineattackmain",TrackOutput:0} destroy
setblock 999991 164 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/autoattackphase2/autoattackmain",TrackOutput:0} destroy
setblock 999991 165 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/finalstand/finalstandmain",TrackOutput:0} destroy
setblock 999991 166 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:stray,limit=1,tag=CadeyrnTP] run function zzzzdonotuse:cadeyrn/attacks/finalstand/persistentparticles",TrackOutput:0} destroy
setblock 999991 167 999988 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:armor_stand,limit=1,name=CadeyrnFight] run function zzzzdonotuse:cadeyrn/attacks/deathanim/deathmain",TrackOutput:0} destroy

scoreboard objectives add Cadeyrn10Tick dummy
scoreboard objectives add AutoAttackTimer dummy
scoreboard objectives add AttackTimer dummy
scoreboard objectives add DeathTimerKyu dummy
scoreboard objectives add ChangeLocationK dummy
scoreboard objectives add DummyAttackTimer dummy
scoreboard objectives add PosX dummy
scoreboard objectives add PosY dummy
scoreboard objectives add PosZ dummy
scoreboard objectives add PosXTemp dummy
scoreboard objectives add PosYTemp dummy
scoreboard objectives add PosZTemp dummy
scoreboard objectives add BossAutoAttack dummy
scoreboard objectives add KyuDummy dummy
scoreboard objectives add KyuDummy2 dummy
scoreboard objectives add CircleTimer dummy
scoreboard objectives add MoveTimer dummy
scoreboard objectives add CadeyrnBaseHP dummy
scoreboard objectives add CadeyrnMaxHP dummy
scoreboard objectives add CadeyrnCurrentHP dummy
scoreboard objectives add CadeyrnHalfHP dummy
scoreboard objectives add CadeyrnDamTaken dummy
scoreboard objectives add CadeyrnBossBarHP dummy
scoreboard objectives add SandWaveTimer dummy
scoreboard objectives add FourMinTimer dummy
scoreboard objectives add CadeyrnChargeDum dummy
scoreboard objectives add CadCrackTimer dummy
scoreboard objectives add CadChainBreak dummy
scoreboard objectives add CadeyrnFinStHP dummy
scoreboard objectives add GriefZombieKyu dummy
scoreboard objectives add CadeyrnFSMove dummy
scoreboard objectives add CadeyrnPlayers dummy
scoreboard objectives add CadeyrnShopX dummy
scoreboard objectives add CadeyrnShopY dummy
scoreboard objectives add CadeyrnShopZ dummy
scoreboard objectives add CadVexTimer dummy
scoreboard objectives add CadChargePart dummy
scoreboard objectives add ChargePartTimer dummy
scoreboard objectives add ResetAggroTimer dummy
scoreboard objectives add ArmorCheck dummy
scoreboard objectives add ArmorStuff dummy
scoreboard objectives add ArmorToughStuff dummy
scoreboard objectives add VineAttackTimer dummy
scoreboard objectives add CrackAttackTimer dummy
scoreboard objectives add VineGrabTimer dummy
scoreboard objectives add SoulStealTimer dummy
scoreboard objectives add HealthSap dummy
scoreboard objectives add SplodeyCreeper dummy
scoreboard objectives add ZombieCripple dummy
scoreboard objectives add BeeKillKyu dummy
scoreboard objectives add DespawnTimerKyu dummy
scoreboard objectives add KyuEndWall dummy
scoreboard objectives add UUIDKyu dummy
scoreboard objectives add KyuAbsorbAmount dummy
#scoreboard objectives add CadeyrnBossBarHP dummy

scoreboard objectives add KyuShieldBlock minecraft.custom:minecraft.damage_blocked_by_shield

setblock 999978 184 999975 minecraft:chain_command_block[facing=up]{auto:0b,Command:"yarrrrrrr it be glass ward",TrackOutput:0} destroy
setblock 1000000 133 999988 minecraft:command_block[facing=up]{auto:1b,Command:"setblock ~ ~1 ~ dirt",TrackOutput:0} destroy

#spider sac
setblock 999977 187 999977 chain_command_block[facing=up]{auto:1b,Command:"tag @a[tag=K,nbt={Inventory:[{id:\"minecraft:fermented_spider_eye\",tag:{kyuantipoison:1b}}]}] add KyuPI",TrackOutput:0} destroy


#hard difficulty change
data merge block 999977 151 999974 {auto:0b}

#minute timer
#setblock 999977 181 999975 minecraft:chain_command_block[facing=up]{auto:1b,Command:"function zzzzdonotuse:minutetimer/main",TrackOutput:0} destroy
data merge block 999977 169 999977 {auto:0b}


#spider den y level
data modify block 999984 148 999982 Command set value "execute at @e[scores={KyuFillTim=37}] run fill ~ 232 ~ ~ 165 ~ minecraft:command_block{auto:1b,Command:\"fill ~-34 ~ ~-34 ~34 ~ ~34 black_concrete\"} destroy"

#bye bye random events :(
fill 999982 122 999980 999980 146 999971 air destroy
fill 999980 147 999974 999982 169 999971 air destroy
fill 999978 170 999974 999981 238 999971 air destroy
fill 999983 135 999974 999983 155 999974 air destroy
fill 999984 132 999974 999995 134 999974 air destroy
fill 999976 122 999975 999976 138 999975 air destroy
fill 999978 122 999971 999975 143 999972 air destroy
##random event text
fill 999976 133 999978 999976 158 999978 air destroy

#champions
fill 999998 137 999987 999998 219 999987 air destroy

#spells
fill 999995 120 999977 999988 135 999977 air destroy
fill 999996 120 999976 999988 125 999976 air destroy
fill 999996 126 999976 999994 135 999978 air destroy


#moving structure
clone 1000000 120 999973 1000000 131 999973 999999 120 999973 replace move
data modify block 999999 127 999973 Command set value "data merge block ~ ~8 ~ {auto:1b}"
setblock 999999 120 999972 minecraft:redstone_block

#put in start function
forceload remove 1000001 999970 1000001 999989

#random junk lol
fill 999984 137 999988 999984 189 999988 air destroy


#TREE
#fill 999990 152 999982 999990 205 999982 air destroy

#RDT
setblock 999984 121 999980 air
#sinkhole
setblock 999976 122 999981 air
#portal stand
data merge block 999976 125 999981 {auto:0b}
#portal scoreboard
data merge block 999976 138 999981 {auto:0b}
#10 tick timer
data merge block 999979 156 999975 {auto:0b}


#eternal night event
setblock 999982 122 999979 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:randomevent/eternalnighttimer1",TrackOutput:0} destroy
setblock 999982 123 999979 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:randomevent/eternalnighttimer2",TrackOutput:0} destroy

#lava dungeon
setblock 999982 122 999978 repeating_command_block[facing=up]{auto:0b,Command:"function zzzzdonotuse:randomevent/lavadungeonsearch",TrackOutput:0} destroy
setblock 999982 123 999978 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=LavD] run function zzzzdonotuse:randomevent/lavadungeontimer",TrackOutput:0} destroy

#griefer zombie
setblock 999982 122 999977 repeating_command_block[facing=up]{auto:0b,Command:"function zzzzdonotuse:randomevent/grieferzombietimer1",TrackOutput:0} destroy
setblock 999982 123 999977 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:randomevent/grieferzombietimer2",TrackOutput:0} destroy
setblock 999982 124 999977 repeating_command_block[facing=up]{auto:0b,Command:"function zzzzdonotuse:randomevent/grieferzombieboomtimer",TrackOutput:0} destroy

#bless the ground
setblock 999982 122 999976 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=BTG] run execute at @s run function zzzzdonotuse:randomevent/blessthegroundtimer",TrackOutput:0} destroy

#bless the tnt
setblock 999982 122 999975 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=BTTNT] run execute at @s run function zzzzdonotuse:randomevent/nethercrackletimer",TrackOutput:0} destroy

#overworld spider den
setblock 999982 122 999974 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=KyuOffShootOW2] run execute at @s run function zzzzdonotuse:randomevent/spiderdentimer1",TrackOutput:0} destroy
setblock 999982 123 999974 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=KyuOffShootOW2] run execute at @s run function zzzzdonotuse:randomevent/spiderdentimer2",TrackOutput:0} destroy
setblock 999982 124 999974 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=KyuOffShootOW] run execute at @s run function zzzzdonotuse:randomevent/spiderdentimer3",TrackOutput:0} destroy
setblock 999982 125 999974 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=GlowyChestOW] run execute at @s run function zzzzdonotuse:randomevent/spiderdenlootchests",TrackOutput:0} destroy

#hellfire
setblock 999982 122 999973 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run execute at @s run function zzzzdonotuse:randomevent/hellfiretimer1",TrackOutput:0} destroy
setblock 999982 123 999973 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run execute at @s run function zzzzdonotuse:randomevent/hellfiretimer2",TrackOutput:0} destroy

#silverfishy
setblock 999982 122 999972 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run execute at @s run function zzzzdonotuse:randomevent/silverfishytimer",TrackOutput:0} destroy

#meteor storm
setblock 999982 122 999980 repeating_command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run execute at @s run function zzzzdonotuse:randomevent/meteorstormtimer",TrackOutput:0} destroy

#creeper zombie
setblock 999980 122 999971 repeating_command_block[facing=up]{auto:0b,Command:"function zzzzdonotuse:specialzombie/zombiecreepertimer1",TrackOutput:0} destroy

#cripple zombie
setblock 999979 122 999971 repeating_command_block[facing=up]{auto:0b,Command:"function zzzzdonotuse:specialzombie/cripplezombietimer",TrackOutput:0} destroy



data modify block 999986 137 999978 Command set value "execute at @a[sort=random,limit=1] run spreadplayers ~ ~ 20 95 false @e[type=armor_stand,name=OreL]"
data modify block 999986 138 999978 Command set value "execute at @e[type=armor_stand,name=OreL] run execute if block ~ 127 ~ air run scoreboard players add @p TestforReplace 1"
data modify block 999986 139 999978 Command set value "execute at @e[type=armor_stand,name=OreL] run execute if block ~ 0 ~ bedrock run scoreboard players add @p TestforReplace 1"
data modify block 999986 140 999978 Command set value "execute at @e[type=armor_stand,name=OreL] run fill ~-5 13 ~-5 ~5 13 ~5 bedrock replace redstone_ore"
data modify block 999986 141 999978 Command set value "execute at @e[type=armor_stand,name=OreL] run fill ~-5 13 ~-5 ~5 13 ~5 redstone_ore replace bedrock"
data modify block 999986 142 999978 Command set value "execute at @e[type=armor_stand,name=OreL] run fill ~-5 24 ~-5 ~5 24 ~5 bedrock replace gold_ore"
data modify block 999986 143 999978 Command set value "execute at @e[type=armor_stand,name=OreL] run fill ~-5 24 ~-5 ~5 24 ~5 gold_ore replace bedrock"


#structuresv2
fill 999999 132 999973 999999 134 999973 air
fill 999999 129 999973 999999 130 999973 air
fill 999981 126 999984 999981 128 999983 air
data modify block 999999 128 999973 Command set value "execute as @e[name=OreL3,type=minecraft:armor_stand] run function zzzzdonotuse:1tick/structurestags"

data merge block 999978 175 999975 {auto:0b}
setblock 999978 174 999975 chain_command_block[facing=up]{auto:1b,Command:"execute as @a[tag=K,nbt={SelectedItem:{id:\"minecraft:paper\",tag:{Enchantments:[{}]}}},tag=!SpellUpdate] run function zzzzdonotuse:spell/consumepagemain",TrackOutput:0} destroy

#day timer stuff
fill 999977 126 999980 999977 170 999980 air destroy
fill 999976 129 999979 999976 170 999979 air destroy


#hardmode old drop enderman
data merge block 999977 150 999974 {auto:0b}

gamerule maxCommandChainLength 999999999

#spiderden
data modify block 999984 173 999978 Command set value "function minecraft:newspoodertest1"

setblock 999977 125 999980 chain_command_block[facing=up]{auto:1b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:daytimer/daytimermain",TrackOutput:0} destroy
setblock 999976 122 999979 command_block[facing=up]{auto:0b,Command:"scoreboard players add @e[name=DayQ] DayQ2 1",TrackOutput:0} destroy
setblock 999976 125 999979 chain_command_block[facing=up]{auto:1b,Command:"tellraw @a[team=P] [\"\",{\"text\":\"You are on Day \",\"color\":\"green\"},{\"score\":{\"name\":\"@e[name=DayQ]\",\"objective\":\"DayQ2\"},\"color\":\"green\"},{\"text\":\".\",\"color\":\"green\"}]",TrackOutput:0} destroy
#data merge block 999976 126 999979 {auto:0b}
setblock 999976 126 999979 air

setblock 999988 126 999976 repeating_command_block[facing=up]{auto:1b,Command:"function zzzzdonotuse:spell/normalspells/escapeladderstand",TrackOutput:0} destroy
fill 999988 127 999976 999988 131 999976 air destroy

#data modify block 999978 127 999975 Command set value "execute if entity @e[type=fireball] run function zzzzdonotuse:fix/ghastfireball"

data modify block 999976 123 999978 Command set value "function zzzzdonotuse:7sec/randomevent"
data modify block 999976 124 999978 Command set value "function zzzzdonotuse:1tick/main"
fill 999976 125 999978 999976 132 999978 air




setblock 999980 140 999973 command_block[facing=up]{auto:0b,Command:"data merge block ~ ~ ~ {auto:0b}",TrackOutput:0} destroy
setblock 999980 141 999973 chain_command_block[facing=up]{auto:1b,Command:"execute as @a[gamemode=!spectator,tag=K,tag=!KyuDoStripMine,scores={KAIR=450..}] run function zzzzdonotuse:stripmine/stripminestart",TrackOutput:0} destroy

data modify block 999978 182 999975 Command set value "execute if entity @e[type=armor_stand,name=DayQ,tag=!NoSpecBlind] run effect give @a[tag=DeadKyu] blindness 900000 9"



#tree
fill 999990 152 999982 999990 205 999982 air destroy
data merge block 999999 164 999973 {auto:0b}
data merge block 999999 165 999973 {auto:0b}
data merge block 999999 166 999973 {auto:0b}
data merge block 999999 167 999973 {auto:0b}
data merge block 999999 168 999973 {auto:0b}
data merge block 999999 169 999973 {auto:0b}


#spooder den
data merge block 999984 137 999975 {auto:0b}

scoreboard objectives add WitchyClockKyu dummy
setblock 999989 138 999988 repeating_command_block[facing=up]{auto:1b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:trinketeffect/dayextenderclock",TrackOutput:0} destroy
setblock 999979 144 999976 chain_command_block[facing=up]{auto:1b,Command:"execute as @a[tag=DuskDraught,predicate=suhc:onsurface] run function zzzzdonotuse:7sec/duskdraughteffect",TrackOutput:0} destroy

setblock 999991 161 999973 chain_command_block[facing=up]{auto:1b,Command:"function zzzzdonotuse:stranger/strangerchance",TrackOutput:0} destroy
setblock 999996 131 999977 chain_command_block[facing=down]{auto:1b,Command:"execute if entity @a[scores={KyuSpells=1000..1020}] run function zzzzdonotuse:misc/starteritem",TrackOutput:0} destroy


setblock 999977 129 999977 chain_command_block[facing=up]{auto:1b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:7sec/main2",TrackOutput:0} destroy
setblock 999977 122 999976 command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:7sec/main2v2",TrackOutput:0} destroy
setblock 999979 122 999976 command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:7sec/main1",TrackOutput:0} destroy
setblock 999979 122 999975 command_block[facing=up]{auto:0b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:7sec/main1v2",TrackOutput:0} destroy
setblock 999977 128 999977 chain_command_block[facing=up]{auto:1b,Command:"execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:7sec/mobarmor",TrackOutput:0} destroy

setblock 999976 133 999975 chain_command_block[facing=up]{auto:1b,Command:"execute at @p[tag=K,scores={TKQ=51..900},nbt={Dimension:\"minecraft:overworld\"}] run execute if entity @e[type=armor_stand,name=DayQ,tag=!NoMetStorm] run execute at @e[sort=random,name=Meteor,type=armor_stand,limit=1] positioned ~ ~-3 ~ run summon fireball ~ 255 ~ {CustomName:\"\\\"i\\\"\",direction:[0.0,-0.2,0.0],power:[0.0,-0.2,0.0],ExplosionPower:2}",TrackOutput:0} destroy
setblock 999976 126 999975 chain_command_block[facing=up]{auto:1b,Command:"execute at @a[limit=1,sort=random,tag=K] run spreadplayers ~ ~ 1 155 false @e[name=Meteor]",TrackOutput:0} destroy
setblock 999976 134 999975 chain_command_block[facing=up]{auto:1b,Command:"execute at @p[tag=K,scores={TKQ=998..999}] run kill @e[type=item,tag=!SaveItem]",TrackOutput:0} destroy
setblock 999976 128 999975 chain_command_block[facing=up]{auto:1b,Command:"execute at @p[tag=K,scores={EQK=9149}] run execute at @a[tag=K] run kill @e[distance=9..150,type=item,tag=!SaveItem]",TrackOutput:0} destroy
setblock 999981 134 999978 chain_command_block[facing=up]{auto:1b,Command:"execute as @a[tag=K,nbt=!{Dimension:\"minecraft:overworld\"}] run kill @e[type=minecraft:armor_stand,name=BUQ,distance=..250]",TrackOutput:0} destroy
data modify block 999978 127 999975 Command set value "function zzzzdonotuse:fix/ghastfireball"
fill 999978 128 999975 999978 134 999975 minecraft:chain_command_block[facing=up] destroy

data modify block 999978 123 999975 Command set value "execute at @a[tag=K,gamemode=survival] run execute as @e[distance=..8,type=zombified_piglin,tag=!PigAggrod] run function zzzzdonotuse:fix/pigaggro"
data modify block 999979 162 999975 Command set value "execute at @a[tag=K,gamemode=survival] run execute as @e[distance=..16,type=zombified_piglin] run function zzzzdonotuse:fix/pigaggro"
setblock 999977 180 999975 chain_command_block[facing=up]{auto:1b,Command:"tag @e[type=zombified_piglin] remove PigAggrod",TrackOutput:0} destroy

#setblock 999979 146 999975 chain_command_block[facing=up]{auto:0b,Command:"execute as @e[type=minecraft:zombified_piglin,tag=K,tag=!SuperHostile,tag=!CopyKyu] run data merge entity @s {ArmorItems:[{},{id:potion,Count:1,tag:{Potion:\"minecraft:strong_healing\"}},{id:gold_ingot,Count:1},{id:blaze_powder,Count:1}],ArmorDropChances:[0.0F,0.0F,0.35F,0.02F],DeathLootTable:\"--\"}",TrackOutput:0} destroy

tag @e[name=KyuPatch,type=armor_stand] add PatchOnePointFour
tellraw @a ["",{"text":"Patch 1.4 has been installed!","color":"gold"},{"text":"","color":"red"}]
execute as @e[tag=CurrentPatch] run data merge entity @s[tag=CurrentPatch] {CustomName:"\"Patch 1.4\"",Tags:["CurrentPatch"],NoGravity:1,Invisible:1b,Silent:1b,Invulnerable:1}



#execute as @e[type=armor_stand,name=DayQ] run function zzzzdonotuse:difficulty/normaldifficulty