
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 WitchyClockKyu dummy
setblock 999989 138 999988 repeating_command_block[facing=up]{auto:0b,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 PatchOnePointThreePointTwo
tellraw @a ["",{"text":"Patch 1.3.2 has been installed!","color":"gold"},{"text":"","color":"red"}]
execute as @e[tag=CurrentPatch] run data merge entity @s[tag=CurrentPatch] {CustomName:"\"Patch 1.3.2\"",Tags:["CurrentPatch"],NoGravity:1,Invisible:1b,Silent:1b,Invulnerable:1}