setblock 999986 147 999976 chain_command_block[facing=up]{auto:1b,Command:"execute at @e[scores={GoldyKyu=63..74}] run summon minecraft:zombified_piglin ~ 130 ~ {NoGravity:1,Tags:[\"KyuGoldPig\"],Anger:12000,HandItems:[{id:\"minecraft:golden_sword\",Count:1b},{}],Attributes:[{Name:generic.movement_speed,Base:0.25},{Name:generic.followRange,Base:50}],PersistenceRequired:1,active_effects:[{id:"minecraft:resistance",amplifier:4,duration:200,show_particles:0b}]}",TrackOutput:0} destroy
setblock 999981 147 999981 chain_command_block[facing=up]{auto:1b,Command:"execute at @e[name=Crater,scores={Crater=33}] run summon fireball ~-4 ~ ~-4 {power:[0.01,-10.0,0.0],direction:[0.01,-10.0,0.0],ExplosionPower:10}",TrackOutput:0} destroy
setblock 999981 141 999981 chain_command_block[facing=up]{auto:1b,Command:"execute at @e[name=Crater,scores={Crater=1..30}] run summon fireball ~ ~-4 ~ {CustomName:\"\\\"i\\\"\",power:[0.01,-10.0,0.0],direction:[0.01,-10.0,0.0],ExplosionPower:4}",TrackOutput:0} destroy
data merge block 999975 131 999972 {auto:0b}
setblock 999979 180 999975 chain_command_block[facing=up]{auto:1b,Command:"execute if entity @a[tag=DeadKyu,gamemode=spectator] run function zzzzdonotuse:misc/spectatortp",TrackOutput:0} destroy


setblock 999995 121 999976 chain_command_block[facing=up]{auto:1b,Command:"execute as @a[scores={KyuSpells=1},nbt={Dimension:\"minecraft:overworld\",Inventory:[{id:\"minecraft:golden_apple\"}]}] store result score @e[name=DayQ] PosX run data get entity @s Pos[0] 1",TrackOutput:0} destroy
setblock 999995 122 999976 chain_command_block[facing=up]{auto:1b,Command:"execute as @a[scores={KyuSpells=1},nbt={Dimension:\"minecraft:overworld\",Inventory:[{id:\"minecraft:golden_apple\"}]}] store result score @e[name=DayQ] PosY run data get entity @s Pos[1] 1",TrackOutput:0} destroy
setblock 999995 123 999976 chain_command_block[facing=up]{auto:1b,Command:"execute as @a[scores={KyuSpells=1},nbt={Dimension:\"minecraft:overworld\",Inventory:[{id:\"minecraft:golden_apple\"}]}] store result score @e[name=DayQ] PosZ run data get entity @s Pos[2] 1",TrackOutput:0} destroy
setblock 999995 124 999976 chain_command_block[facing=up]{auto:1b,Command:"execute at @a[scores={KyuSpells=1},nbt={Dimension:\"minecraft:overworld\",Inventory:[{id:\"minecraft:golden_apple\"}]}] run forceload add ~ ~",TrackOutput:0} destroy
setblock 999995 125 999976 chain_command_block[facing=up]{auto:1b,Command:"tellraw @a[scores={KyuSpells=1},nbt={Dimension:\"minecraft:overworld\",Inventory:[{id:\"minecraft:golden_apple\"}]}] [\"\",{\"text\":\"The world home has been set!\",\"color\":\"yellow\"}]",TrackOutput:0} destroy
setblock 999995 126 999976 chain_command_block[facing=up]{auto:1b,Command:"tellraw @a[scores={KyuSpells=1},nbt=!{Dimension:\"minecraft:overworld\",Inventory:[{id:\"minecraft:golden_apple\"}]}] [\"\",{\"text\":\"You must be in the overworld and have a golden apple in order to set a world home!\",\"color\":\"gold\"}]",TrackOutput:0} destroy
setblock 999995 127 999976 chain_command_block[facing=up]{auto:1b,Command:"clear @a[scores={KyuSpells=1},nbt={Dimension:\"minecraft:overworld\",Inventory:[{id:\"minecraft:golden_apple\"}]}] minecraft:golden_apple 1",TrackOutput:0} destroy

setblock 999994 121 999976 chain_command_block[facing=up]{auto:1b,Command:"execute if entity @e[name=DayQ,tag=HomeMadeQ] run tellraw @a[level=5..,scores={KyuSpells=2},tag=!HomeCD,nbt={Dimension:\"minecraft:overworld\"}] [\"\",{\"text\":\"Portal made!\",\"color\":\"green\"}]",TrackOutput:0} destroy
setblock 999994 122 999976 chain_command_block[facing=up]{auto:1b,Command:"execute if entity @e[name=DayQ,tag=HomeMadeQ] run execute at @e[level=5..,scores={KyuSpells=2},tag=!HomeCD,nbt={Dimension:\"minecraft:overworld\"}] run summon minecraft:armor_stand ~2 ~2 ~  {CustomName:\"\\\"HomeTP\\\"\",NoGravity:1,Invisible:1b,Silent:1b}",TrackOutput:0} destroy
setblock 999994 135 999977 chain_command_block[facing=down]{auto:1b,Command:"tellraw @a[scores={KyuSpells=2},nbt=!{Dimension:\"minecraft:overworld\"}] [\"\",{\"text\":\"You must be in the minecraft:overworld to do this.\",\"color\":\"gold\"}]",TrackOutput:0} destroy
setblock 999994 134 999977 chain_command_block[facing=down]{auto:1b,Command:"execute if entity @e[name=DayQ,tag=HomeMadeQ] run tag @a[scores={KyuSpells=2},level=5..,nbt={Dimension:\"minecraft:overworld\"}] add HomeCD2",TrackOutput:0} destroy
setblock 999994 133 999977 chain_command_block[facing=down]{auto:1b,Command:"execute if entity @e[name=DayQ,tag=HomeMadeQ] run xp add @a[scores={KyuSpells=2},tag=!HomeCD,level=5..,nbt={Dimension:\"minecraft:overworld\"}] -55 points",TrackOutput:0} destroy
setblock 999994 132 999977 chain_command_block[facing=down]{auto:1b,Command:"execute if entity @e[name=DayQ,tag=HomeMadeQ] run tag @a[nbt={Dimension:\"minecraft:overworld\"},tag=HomeCD2] add HomeCD",TrackOutput:0} destroy

setblock 999976 133 999975 chain_command_block[facing=up]{auto:1b,Command:"execute at @p[tag=K,scores={TKQ=51..900}] 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,nbt={Dimension:\"minecraft:overworld\"}] 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 999981 134 999978 chain_command_block[facing=up]{auto:1b,Command:"execute as @e[type=minecraft:armor_stand,name=BUQ] run kill @s[nbt=!{Dimension:\"minecraft:overworld\"}]",TrackOutput:0} destroy
tag @e[name=KyuPatch,type=armor_stand] add PatchOnePointThreePointOne
tellraw @a ["",{"text":"Patch 1.3.1 has been installed!","color":"gold"},{"text":"","color":"red"}]
execute as @e[tag=CurrentPatch] run data merge entity @s[tag=CurrentPatch] {CustomName:"\"Patch 1.3.1\"",Tags:["CurrentPatch"],NoGravity:1,Invisible:1b,Silent:1b,Invulnerable:1}

