execute as @a[tag=!red,tag=!blue,tag=!green,tag=!yellow,tag=!gray,tag=!white,tag=!aqua,tag=!pink] at @s if entity @e[tag=timer,scores={gametimer=160..}] run gamemode spectator @s
clear @a[gamemode=adventure] stick
clear @a[gamemode=adventure] #minecraft:carpets
clear @a[gamemode=adventure] crafting_table
clear @a[gamemode=adventure] #minecraft:wooden_pressure_plates
scoreboard objectives add leave minecraft.custom:minecraft.leave_game
scoreboard objectives add joinG dummy

execute run scoreboard players add @a[scores={leave=1..}] joinG 1
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove red
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove blue
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove green
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove yellow
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove gray
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove white
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove aqua
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove pink
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove chainboots
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove chainlegs
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove ironboots
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove ironlegs
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove diaboots
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run tag @s remove dialegs
execute as @a[scores={joinG=100..}] at @s unless entity @e[tag=timer,scores={gametimer=100..}] run clear @s

execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=redB,scores={broke=1..}] run tag @s remove red
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=blueB,scores={broke=1..}] run tag @s remove blue
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=greenB,scores={broke=1..}] run tag @s remove green
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=yellowB,scores={broke=1..}] run tag @s remove yellow
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=grayB,scores={broke=1..}] run tag @s remove gray
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=whiteB,scores={broke=1..}] run tag @s remove white
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=aquaB,scores={broke=1..}] run tag @s remove aqua
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={gametimer=100..}] if entity @e[tag=pinkB,scores={broke=1..}] run tag @s remove pink

execute unless entity @e[tag=timer,scores={gametimer=100..}] if score #count forge matches 4.. if score #count1 forge matches 4.. if score #count2 forge matches 8.. if score #count3 forge matches 8.. if score #count4 forge matches 8.. if score #count5 forge matches 8.. if score #count6 forge matches 8.. if score #count7 forge matches 1.. run tellraw @a[scores={joinG=100}] [{"text":"Click \"","color":"white","bold":"true"},{"text":"[YES]","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/scoreboard players add @e[tag=timer] clicktimer 1"}},{"text":"\" when you are ready to start the game","color":"white","bold":"true"}]
execute as @a[scores={joinG=100..}] at @s if entity @e[tag=timer,scores={clicktimer=1..}] unless entity @e[tag=timer,scores={gametimer=100..}] run tellraw @s ["",{"text":"-+=","obfuscated":true},{"text":"Please choose a Team","bold":true},{"text":"=+-","obfuscated":true},{"text":"\n\n"},{"text":"     ","color":"red"},{"text":"[RED]","color":"red","clickEvent":{"action":"run_command","value":"/trigger trigger add 1"}},{"text":"               ","color":"red"},{"text":"[BLUE]","color":"dark_blue","clickEvent":{"action":"run_command","value":"/trigger trigger add 2"}},{"text":"\n\n"},{"text":"     ","color":"green"},{"text":"[GREEN]","color":"green","clickEvent":{"action":"run_command","value":"/trigger trigger add 3"}},{"text":"          ","color":"green"},{"text":"[YELLOW]","color":"yellow","clickEvent":{"action":"run_command","value":"/trigger trigger add 4"}},{"text":"\n\n"},{"text":"     ","color":"aqua"},{"text":"[AQUA]","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger trigger add 5"}},{"text":"             ","color":"aqua"},{"text":"[WHITE]","clickEvent":{"action":"run_command","value":"/trigger trigger add 6"}},{"text":"\n\n"},{"text":"     ","color":"light_purple"},{"text":"[PINK]","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger trigger add 7"}},{"text":"              ","color":"light_purple"},{"text":"[GRAY]","color":"gray","clickEvent":{"action":"run_command","value":"/trigger trigger add 8"}},{"text":"\n\n            "},{"text":"[SPECTATOR]","color":"gold","clickEvent":{"action":"run_command","value":"/trigger trigger add 9"}}]

scoreboard players reset @a[scores={joinG=100}] leave
scoreboard players reset @a[scores={joinG=100}] joinG


execute unless entity @e[tag=timer,scores={gametimer=100..}] if score #count forge matches 4.. if score #count1 forge matches 4.. if score #count2 forge matches 8.. if score #count3 forge matches 8.. if score #count4 forge matches 8.. if score #count5 forge matches 8.. if score #count6 forge matches 8.. if score #count7 forge matches 1.. run tellraw @a[scores={joinG=400}] [{"text":"Click \"","color":"white","bold":"true"},{"text":"[YES]","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/scoreboard players add @e[tag=timer] clicktimer 1"}},{"text":"\" when you are ready to start the game","color":"white","bold":"true"}]
tellraw @a[tag=fail,scores={joinG=400}] ["",{"text":"====================================================","color":"dark_green"},{"text":"\n"},{"text":"How to set up ","color":"yellow"},{"text":"Cake Wars","color":"gold"},{"text":", by ","color":"yellow"},{"text":"Miles Playz","color":"aqua"},{"text":" "},{"text":"(click for channel)","color":"green","clickEvent":{"action":"open_url","value":"http://www.youtube.com/c/milesplayzminecraft"}},{"text":"\n"},{"text":"Hover over each number to see the step:\n","color":"yellow"},{"text":"\u24f5","underlined":true,"color":"yellow","hoverEvent":{"action":"show_text","value":"Do \"/tag @p add give\" in chat to get all the spawn eggs nessisary to set up Cake Wars"}},{"text":"\n","underlined":true,"color":"yellow"},{"text":"\u24f6","underlined":true,"color":"yellow","hoverEvent":{"action":"show_text","value":"Place each spawn egg where you would like that thing to be placed. Shops and diamond upgrades should be put in a cubby so they can't run away. Make sure to place the correct spawn, cake, and forge with the correct team. "}},{"text":"\n","underlined":true,"color":"yellow"},{"text":"\u24f7","underlined":true,"color":"yellow","hoverEvent":{"action":"show_text","value":"sub to Miles Playz on YouTube"}},{"text":"\n"},{"text":"====================================================","color":"dark_green"}]
execute as @a[scores={joinG=400..}] at @s run scoreboard players reset @s leave
execute as @a at @s unless entity @s[scores={leave=1..}] run scoreboard players reset @s joinG
kill @e[type=minecraft:experience_orb]
kill @e[type=item,nbt={Item:{id:"minecraft:shulker_shell",Count:1b}}]
scoreboard objectives add trigger trigger
scoreboard objectives add gametimer dummy
scoreboard objectives add clicktimer dummy
scoreboard objectives add death dummy
scoreboard objectives add forge dummy
scoreboard objectives add bwdeath minecraft.custom:minecraft.deaths
scoreboard objectives add tnt minecraft.used:minecraft.tnt
scoreboard objectives add event dummy
scoreboard objectives add regen dummy
scoreboard objectives add eliminated dummy
scoreboard objectives add invis dummy
scoreboard objectives add ironCount dummy
scoreboard objectives add why dummy
scoreboard objectives add goldCount dummy
scoreboard objectives add emeraldCount dummy
scoreboard objectives add diaCount dummy
scoreboard objectives add Health health {"text":"❤","color":"red"}
scoreboard objectives setdisplay belowName Health
scoreboard objectives setdisplay list Health
team modify none friendlyFire false
team modify red friendlyFire false
team modify blue friendlyFire false
team modify green friendlyFire false
team modify yellow friendlyFire false
team modify white friendlyFire false
team modify gray friendlyFire false
team modify aqua friendlyFire false
team modify pink friendlyFire false
gamerule doLimitedCrafting false
gamerule keepInventory true
gamerule mobGriefing false
gamerule doDaylightCycle false
gamerule doWeatherCycle false
gamerule doMobSpawning false
gamerule naturalRegeneration false
gamerule announceAdvancements false
gamerule randomTickSpeed 0

gamerule sendCommandFeedback false

tag @a[tag=red] remove blue
tag @a[tag=red] remove green
tag @a[tag=red] remove yellow
tag @a[tag=red] remove gray
tag @a[tag=red] remove white
tag @a[tag=red] remove aqua
tag @a[tag=red] remove pink

tag @a[tag=blue] remove red
tag @a[tag=blue] remove green
tag @a[tag=blue] remove yellow
tag @a[tag=blue] remove gray
tag @a[tag=blue] remove white
tag @a[tag=blue] remove aqua
tag @a[tag=blue] remove pink

tag @a[tag=green] remove blue
tag @a[tag=green] remove red
tag @a[tag=green] remove yellow
tag @a[tag=green] remove gray
tag @a[tag=green] remove white
tag @a[tag=green] remove aqua
tag @a[tag=green] remove pink

tag @a[tag=yellow] remove blue
tag @a[tag=yellow] remove green
tag @a[tag=yellow] remove red
tag @a[tag=yellow] remove gray
tag @a[tag=yellow] remove white
tag @a[tag=yellow] remove aqua
tag @a[tag=yellow] remove pink

tag @a[tag=gray] remove blue
tag @a[tag=gray] remove green
tag @a[tag=gray] remove yellow
tag @a[tag=gray] remove red
tag @a[tag=gray] remove white
tag @a[tag=gray] remove aqua
tag @a[tag=gray] remove pink

tag @a[tag=white] remove blue
tag @a[tag=white] remove green
tag @a[tag=white] remove yellow
tag @a[tag=white] remove gray
tag @a[tag=white] remove red
tag @a[tag=white] remove aqua
tag @a[tag=white] remove pink

tag @a[tag=aqua] remove blue
tag @a[tag=aqua] remove green
tag @a[tag=aqua] remove yellow
tag @a[tag=aqua] remove gray
tag @a[tag=aqua] remove white
tag @a[tag=aqua] remove red
tag @a[tag=aqua] remove pink

tag @a[tag=pink] remove blue
tag @a[tag=pink] remove green
tag @a[tag=pink] remove yellow
tag @a[tag=pink] remove gray
tag @a[tag=pink] remove white
tag @a[tag=pink] remove aqua
tag @a[tag=pink] remove red

team add red
team add blue
team add green
team add yellow
team add gray
team add white
team add aqua
team add pink
team add none
team add spec
team modify red collisionRule never
team modify blue collisionRule never
team modify green collisionRule never
team modify yellow collisionRule never
team modify gray collisionRule never
team modify white collisionRule never
team modify aqua collisionRule never
team modify pink collisionRule never
team modify red color red
team modify blue color blue
team modify green color green
team modify yellow color yellow
team modify gray color gray
team modify white color white
team modify aqua color aqua
team modify pink color light_purple
team modify red prefix {"text":"[RED] ","color":"red","bold":"true"}
team modify blue prefix {"text":"[BLUE] ","color":"blue","bold":"true"}
team modify green prefix {"text":"[GREEN] ","color":"green","bold":"true"}
team modify yellow prefix {"text":"[YELLOW] ","color":"yellow","bold":"true"}
team modify gray prefix {"text":"[GRAY] ","color":"gray","bold":"true"}
team modify white prefix {"text":"[WHITE] ","color":"white","bold":"true"}
team modify aqua prefix {"text":"[AQUA] ","color":"aqua","bold":"true"}
team modify pink prefix {"text":"[PINK] ","color":"pink","bold":"true"}
team join red @a[tag=red]
team join blue @a[tag=blue]
team join green @a[tag=green]
team join yellow @a[tag=yellow]
team join gray @a[tag=gray]
team join white @a[tag=white]
team join aqua @a[tag=aqua]
team join pink @a[tag=pink]
team join spec @a[tag=spec]

execute if score #count forge matches ..3 run tag @a add fail
execute if score #count1 forge matches ..3 run tag @a add fail
execute if score #count2 forge matches ..7 run tag @a add fail
execute if score #count3 forge matches ..7 run tag @a add fail
execute if score #count4 forge matches ..7 run tag @a add fail
execute if score #count5 forge matches ..7 run tag @a add fail
execute if score #count6 forge matches ..7 run tag @a add fail
execute if score #count7 forge matches 0 run tag @a add fail
execute if score #count forge matches 4.. if score #count1 forge matches 4.. if score #count2 forge matches 8.. if score #count3 forge matches 8.. if score #count4 forge matches 8.. if score #count5 forge matches 8.. if score #count6 forge matches 8.. if score #count7 forge matches 1.. run tag @a remove fail

execute if entity @e[tag=timer,scores={gametimer=100..}] run gamemode spectator @a[tag=spec]

team join none @a[tag=!spec,tag=!red,tag=!blue,tag=!green,tag=!yellow,tag=!gray,tag=!white,tag=!aqua,tag=!pink]
execute unless entity @e[tag=timer,scores={gametimer=100..}] run scoreboard players reset @a bwdeath

execute as @e[tag=redS] at @s run tp @s ~ ~ ~ facing entity @e[tag=redB,limit=1,sort=nearest] eyes
execute as @e[tag=blueS] at @s run tp @s ~ ~ ~ facing entity @e[tag=blueB,limit=1,sort=nearest] eyes
execute as @e[tag=greenS] at @s run tp @s ~ ~ ~ facing entity @e[tag=greenB,limit=1,sort=nearest] eyes
execute as @e[tag=yellowS] at @s run tp @s ~ ~ ~ facing entity @e[tag=yellowB,limit=1,sort=nearest] eyes
execute as @e[tag=grayS] at @s run tp @s ~ ~ ~ facing entity @e[tag=grayB,limit=1,sort=nearest] eyes
execute as @e[tag=whiteS] at @s run tp @s ~ ~ ~ facing entity @e[tag=whiteB,limit=1,sort=nearest] eyes
execute as @e[tag=aquaS] at @s run tp @s ~ ~ ~ facing entity @e[tag=aquaB,limit=1,sort=nearest] eyes
execute as @e[tag=pinkS] at @s run tp @s ~ ~ ~ facing entity @e[tag=pinkB,limit=1,sort=nearest] eyes

execute as @e[tag=chest] at @s if entity @e[tag=timer,scores={gametimer=1}] run setblock ~ ~ ~ chest replace
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=red] weakness 1 200 true
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=blue] weakness 1 200 true
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=green] weakness 1 200 true
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=yellow] weakness 1 200 true
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=white] weakness 1 200 true
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=gray] weakness 1 200 true
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=aqua] weakness 1 200 true
execute unless entity @e[tag=timer,type=armor_stand,scores={gametimer=160..}] run effect give @a[tag=pink] weakness 1 200 true
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run effect give @a instant_health 1 200 true
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.0 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.1 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.2 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.3 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.4 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.5 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.6 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.7 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.8 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.9 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.10 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.11 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.12 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.13 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.14 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.15 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.16 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.17 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.18 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.19 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.20 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.21 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.22 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.23 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.24 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.25 air
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run replaceitem entity @a enderchest.26 air
execute as @a[nbt={Inventory:[{id:"minecraft:tnt"}]}] at @s unless entity @s[nbt={ActiveEffects:[{Id:14b}]}] run particle dust 1.000 0.000 0.000 1 ~ ~2.3 ~ 0 0 0 1 0 normal
scoreboard players add @a regen 1
scoreboard players add @a join 1
effect give @a[scores={regen=79}] regeneration 1 2 true
scoreboard players reset @a[scores={regen=80..}] regen
execute as @a store result score @s why run data get entity @s Pos[1] 1
execute as @a[gamemode=!spectator,scores={why=..0}] at @s unless entity @s[scores={bwdeath=1..}] run say has died to the void
execute as @a[scores={why=..0}] at @s unless entity @s[scores={bwdeath=1..}] run scoreboard players add @s bwdeath 1
execute as @a[scores={why=0}] at @s unless entity @s[scores={invis=0}] run scoreboard players set @s invis 600
execute as @a[scores={bwdeath=1..,death=100}] at @s run effect clear @s
execute as @a[scores={bwdeath=1..,death=100}] at @s run scoreboard players set @s invis 600
effect give @a saturation 10 100 true
execute if entity @e[tag=timer,scores={gametimer=1..}] run scoreboard players add @e[tag=timer] forge 1
scoreboard players reset @e[tag=timer,scores={forge=1200}] forge
execute as @a at @s if entity @e[tag=timer,scores={gametimer=1}] run tag @a add alive
execute as @a[limit=1] at @s unless entity @e[tag=timer] run summon armor_stand ~ ~ ~ {NoGravity:1b,Tags:["timer"],Marker:1b,Invisible:1b}
execute if score #count1 forge matches 4.. if score #count2 forge matches 8.. if score #count3 forge matches 8.. if score #count4 forge matches 8.. if score #count5 forge matches 8.. if score #count6 forge matches 8.. if score #count7 forge matches 1.. run scoreboard players add @a clicktimer 1

execute unless entity @e[tag=timer,scores={gametimer=100..}] if score #count forge matches 4.. if score #count1 forge matches 4.. if score #count2 forge matches 8.. if score #count3 forge matches 8.. if score #count4 forge matches 8.. if score #count5 forge matches 8.. if score #count6 forge matches 8.. if score #count7 forge matches 1.. run tellraw @a[scores={clicktimer=1}] [{"text":"Click \"","color":"white","bold":"true"},{"text":"[YES]","color":"green","bold":"true","clickEvent":{"action":"run_command","value":"/scoreboard players add @e[tag=timer] clicktimer 1"}},{"text":"\" when you are ready to start the game","color":"white","bold":"true"}]
execute if entity @e[tag=timer,scores={clicktimer=1}] run tellraw @a {"text":" "}
execute if entity @e[tag=timer,scores={clicktimer=1..}] unless entity @e[tag=timer,scores={gametimer=100..}] run scoreboard players enable @a trigger
execute if entity @e[tag=timer,scores={clicktimer=1}] run tellraw @a ["",{"text":"-+=","obfuscated":true},{"text":"Please choose a Team","bold":true},{"text":"=+-","obfuscated":true},{"text":"\n\n"},{"text":"     ","color":"red"},{"text":"[RED]","color":"red","clickEvent":{"action":"run_command","value":"/trigger trigger add 1"}},{"text":"               ","color":"red"},{"text":"[BLUE]","color":"dark_blue","clickEvent":{"action":"run_command","value":"/trigger trigger add 2"}},{"text":"\n\n"},{"text":"     ","color":"green"},{"text":"[GREEN]","color":"green","clickEvent":{"action":"run_command","value":"/trigger trigger add 3"}},{"text":"          ","color":"green"},{"text":"[YELLOW]","color":"yellow","clickEvent":{"action":"run_command","value":"/trigger trigger add 4"}},{"text":"\n\n"},{"text":"     ","color":"aqua"},{"text":"[AQUA]","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger trigger add 5"}},{"text":"             ","color":"aqua"},{"text":"[WHITE]","clickEvent":{"action":"run_command","value":"/trigger trigger add 6"}},{"text":"\n\n"},{"text":"     ","color":"light_purple"},{"text":"[PINK]","color":"light_purple","clickEvent":{"action":"run_command","value":"/trigger trigger add 7"}},{"text":"              ","color":"light_purple"},{"text":"[GRAY]","color":"gray","clickEvent":{"action":"run_command","value":"/trigger trigger add 8"}},{"text":"\n\n            "},{"text":"[SPECTATOR]","color":"gold","clickEvent":{"action":"run_command","value":"/trigger trigger add 9"}}]
scoreboard players add @e[tag=timer,scores={clicktimer=1..}] clicktimer 1
tag @a[scores={trigger=1}] add red
tag @a[scores={trigger=2}] add blue
tag @a[scores={trigger=3}] add green
tag @a[scores={trigger=4}] add yellow
tag @a[scores={trigger=8}] add gray
tag @a[scores={trigger=6}] add white
tag @a[scores={trigger=5}] add aqua
tag @a[scores={trigger=7}] add pink
tag @a[scores={trigger=9}] add spec


scoreboard players reset @a[scores={trigger=1..}] trigger

execute unless entity @a[tag=!spec,tag=!red,tag=!blue,tag=!green,tag=!yellow,tag=!gray,tag=!white,tag=!aqua,tag=!pink] run scoreboard players add @e[tag=timer] gametimer 1
execute if entity @e[tag=timer,type=armor_stand,scores={gametimer=1}] run gamemode adventure @a[tag=!spec]
execute as @e[tag=timer,type=armor_stand] at @s if entity @e[tag=timer,scores={gametimer=0..}] unless entity @e[tag=timer,scores={gametimer=38401..}] run scoreboard players add @s event 1
execute as @e[tag=timer,type=armor_stand,scores={event=9600..}] at @s run scoreboard players reset @s event
execute as @e[tag=timer,scores={gametimer=1}] at @s run clear @a
execute as @e[tag=timer,scores={gametimer=1}] at @s run title @a title {"text":"5","color":"dark_green","bold":"true"}
execute as @e[tag=timer,scores={gametimer=40}] at @s run title @a title {"text":"4","color":"green","bold":"true"}
execute as @e[tag=timer,scores={gametimer=80}] at @s run title @a title {"text":"3","color":"gold","bold":"true"}
execute as @e[tag=timer,scores={gametimer=100}] at @s run title @a title {"text":"2","color":"yellow","bold":"true"}
execute as @e[tag=timer,scores={gametimer=120}] at @s run title @a title {"text":"1","color":"red","bold":"true"}
execute as @e[tag=timer,scores={gametimer=160}] at @s run title @a title {"text":"GO","color":"green","bold":"true"}
execute as @e[tag=timer,scores={gametimer=160}] at @s unless entity @s[nbt={Inventory:[{id:"minecraft:wooden_sword"}]}] run give @a minecraft:wooden_sword{CanDestroy:["#break"],HideFlags:14,Unbreakable:1b,AttributeModifiers:[{AttributeName:"generic.attackSpeed",Name:"generic.attackSpeed",Amount:10,Operation:0,UUIDLeast:954921,UUIDMost:548372},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:5,Operation:0,UUIDLeast:135599,UUIDMost:893074,Slot:"mainhand"}]} 1
execute as @e[tag=timer,scores={gametimer=160}] at @s run tellraw @a ["",{"text":"==========================================","color":"dark_green"},{"text":"\n                  "},{"text":"CAKE WARS","color":"aqua"},{"text":"\n               "},{"text":"by Miles Playz","bold":true,"underlined":true,"color":"light_purple"},{"text":"\n\n"},{"text":"Creator's Channel: ","color":"aqua"},{"text":"[CLICK]","color":"green","clickEvent":{"action":"open_url","value":"https://www.youtube.com/c/milesplayzminecraft"}},{"text":"\n\n"},{"text":"How To Play:\nGet items from your forge to purchase items from\nthe shops. Use these items to protect and defend\nyour bed. Attack other teams, destroy their bed\nand be the last one standing!\n\n==========================================","color":"dark_green"}]
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=red] armor.head minecraft:leather_helmet{display:{color:16711680},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=red] armor.chest minecraft:leather_chestplate{display:{color:16711680},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=red] armor.legs minecraft:leather_leggings{display:{color:16711680},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=red] armor.feet minecraft:leather_boots{display:{color:16711680},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=blue] armor.head minecraft:leather_helmet{display:{color:6911},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=blue] armor.chest minecraft:leather_chestplate{display:{color:6911},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=blue] armor.legs minecraft:leather_leggings{display:{color:6911},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=blue] armor.feet minecraft:leather_boots{display:{color:6911},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=green] armor.head minecraft:leather_helmet{display:{color:65331},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=green] armor.chest minecraft:leather_chestplate{display:{color:65331},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=green] armor.legs minecraft:leather_leggings{display:{color:65331},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=green] armor.feet minecraft:leather_boots{display:{color:65331},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=gray] armor.head minecraft:leather_helmet{display:{color:8882055},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=gray] armor.chest minecraft:leather_chestplate{display:{color:8882055},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=gray] armor.legs minecraft:leather_leggings{display:{color:8882055},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=gray] armor.feet minecraft:leather_boots{display:{color:8882055},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=yellow] armor.head minecraft:leather_helmet{display:{color:16774920},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=yellow] armor.chest minecraft:leather_chestplate{display:{color:16774920},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=yellow] armor.legs minecraft:leather_leggings{display:{color:16774920},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=yellow] armor.feet minecraft:leather_boots{display:{color:16774920},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=white] armor.head minecraft:leather_helmet{display:{color:16777215},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=white] armor.chest minecraft:leather_chestplate{display:{color:16777215},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=white] armor.legs minecraft:leather_leggings{display:{color:16777215},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=white] armor.feet minecraft:leather_boots{display:{color:16777215},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=aqua] armor.head minecraft:leather_helmet{display:{color:5898239},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=aqua] armor.chest minecraft:leather_chestplate{display:{color:5898239},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=aqua] armor.legs minecraft:leather_leggings{display:{color:5898239},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=aqua] armor.feet minecraft:leather_boots{display:{color:5898239},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=pink] armor.head minecraft:leather_helmet{display:{color:16756218},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=pink] armor.chest minecraft:leather_chestplate{display:{color:16756218},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=pink] armor.legs minecraft:leather_leggings{display:{color:16756218},HideFlags:3,Unbreakable:1b} 1
execute if entity @e[tag=timer,scores={gametimer=160}] run replaceitem entity @a[team=pink] armor.feet minecraft:leather_boots{display:{color:16756218},HideFlags:3,Unbreakable:1b} 1
execute as @a[tag=red] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=redS,limit=1]
execute as @a[tag=blue] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=blueS,limit=1]
execute as @a[tag=green] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=greenS,limit=1]
execute as @a[tag=yellow] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=yellowS,limit=1]
execute as @a[tag=gray] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=grayS,limit=1]
execute as @a[tag=white] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=whiteS,limit=1]
execute as @a[tag=aqua] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=aquaS,limit=1]
execute as @a[tag=pink] at @s if entity @e[tag=timer,scores={gametimer=160}] run tp @s @e[tag=pinkS,limit=1]
execute as @e[tag=bed] at @s if entity @e[tag=timer,scores={gametimer=100}] run setblock ~ ~ ~ cake
execute as @e[tag=bed] at @s if entity @e[tag=timer,scores={gametimer=100}] run scoreboard players reset @e[tag=bed] broke
execute as @e[tag=forge] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add level1
execute as @e[tag=redF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=blueF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=greenF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=yellowF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=grayF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=whiteF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=aquaF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=pinkF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=diaF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=emeraldF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add active
execute as @e[tag=diaF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add level1
execute as @e[tag=emeraldF] at @s if entity @e[tag=timer,scores={gametimer=100}] run tag @s add level1
execute as @e[tag=diaF] at @s if entity @e[tag=timer,scores={gametimer=9600}] run tag @s add level2
execute as @e[tag=timer] at @s if entity @e[tag=timer,scores={gametimer=9600}] run tellraw @a {"text":"Diamond Generators Are Now Tier 2","color":"aqua","bold":"true"}
execute as @e[tag=emeraldF] at @s if entity @e[tag=timer,scores={gametimer=19200}] run tag @s add level2
execute as @e[tag=timer] at @s if entity @e[tag=timer,scores={gametimer=19200}] run tellraw @a {"text":"Emerald Generators Are Now Tier 2","color":"green","bold":"true"}
execute as @e[tag=diaF] at @s if entity @e[tag=timer,scores={gametimer=28800}] run tag @s add level3
execute as @e[tag=timer] at @s if entity @e[tag=timer,scores={gametimer=28800}] run tellraw @a {"text":"Diamond Generators Are Now Tier 3","color":"aqua","bold":"true"}
execute as @e[tag=emeraldF] at @s if entity @e[tag=timer,scores={gametimer=38400}] run tag @s add level3
execute as @e[tag=timer] at @s if entity @e[tag=timer,scores={gametimer=38400}] run tellraw @a {"text":"Emerald Generators Are Now Tier 3","color":"green","bold":"true"}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=30}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=60}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=90}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=120}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=150}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=180}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=210}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=240}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=270}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=300}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=330}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=360}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=390}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=420}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=450}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=480}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=510}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=540}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=570}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=600}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=630}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=660}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=690}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=720}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=750}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=780}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=810}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=840}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=870}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=900}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=930}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=960}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=990}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1020}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1050}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1080}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1110}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1140}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1170}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1200}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=90}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=180}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=270}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=360}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=510}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=660}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=690}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=780}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=870}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=960}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1050}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level1,tag=active] at @s if entity @e[tag=timer,scores={forge=1140}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=30}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=60}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=90}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=120}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=150}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=180}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=210}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=240}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=270}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=300}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=330}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=360}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=390}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=420}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=450}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=480}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=510}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=540}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=570}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=600}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=630}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=660}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=690}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=720}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=750}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=780}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=810}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=840}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=870}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=900}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=930}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=960}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=990}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=1020}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=1050}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=1080}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=1110}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=1140}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=1170}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level2,tag=active] at @s if entity @e[tag=timer,scores={forge=1200}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=90}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=180}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=270}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=360}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=510}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=660}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=690}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=780}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=870}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=960}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=1050}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level3,tag=active] at @s if entity @e[tag=timer,scores={forge=1140}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level4,tag=active] at @s if entity @e[tag=timer,scores={forge=90}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:emerald",Count:2b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level4,tag=active] at @s if entity @e[tag=timer,scores={forge=360}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:emerald",Count:2b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level4,tag=active] at @s if entity @e[tag=timer,scores={forge=690}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:emerald",Count:2b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=forge,tag=level4,tag=active] at @s if entity @e[tag=timer,scores={forge=960}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:emerald",Count:2b}}] run summon item ~ ~ ~ {Tags:["forgeI"],Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}

execute as @e[tag=pickup,nbt={Item:{id:"minecraft:gold_ingot"}}] at @s if entity @a[distance=..1.8] run scoreboard players add @s forge 1
execute as @e[tag=pickup,nbt={Item:{id:"minecraft:iron_ingot"}}] at @s if entity @a[distance=..1.8] run scoreboard players add @s forge 1
execute as @e[tag=pickup,nbt={Item:{id:"minecraft:emerald"}}] at @s if entity @a[distance=..1.8] run scoreboard players add @s forge 1

execute as @e[tag=forgeI,type=item] at @s run data merge entity @s {PickupDelay:20}
execute as @e[tag=forgeI,type=item] at @s if entity @a[gamemode=!spectator,distance=..2] run tag @s add pickup
execute as @e[scores={forge=1},tag=pickup,nbt={Item:{id:"minecraft:gold_ingot",Count:1b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 1
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:2b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 2
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:3b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 3
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:4b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 4
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:6b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 5
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:6b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 6
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:7b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 7
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:8b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 8
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:9b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 9
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:10b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 10
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:11b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 11
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:12b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 12
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:13b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 13
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:14b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 14
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:15b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 15
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot",Count:16b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] gold_ingot{CanDestroy:["#break"],HideFlags:8} 16
kill @e[scores={forge=2..},tag=pickup,type=item,nbt={Item:{id:"minecraft:gold_ingot"}}]

execute as @e[scores={forge=1},tag=pickup,nbt={Item:{id:"minecraft:iron_ingot",Count:1b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 1

execute as @e[scores={forge=1},tag=pickup,nbt={Item:{id:"minecraft:iron_ingot",Count:1b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 1
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:2b}}] at @s if entity @a[distance=..2] if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 2
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:3b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 3
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:4b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 4
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:6b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 5
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:6b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 6
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:7b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 7
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:8b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 8
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:9b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 9
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:10b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 10
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:11b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 11
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:12b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 12
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:13b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 13
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:14b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 14
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:15b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 15
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:16b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 16
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:17b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 17
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:18b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 18
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:19b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 19
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:20b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 20
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:21b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 21
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:22b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 22
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:23b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 23
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:24b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 24
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:25b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 25
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:26b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 26
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:27b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 27
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:28b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 28
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:29b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 29
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:30b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 30
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:31b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 31
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:32b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 32
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:33b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 33
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:34b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 34
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:35b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 35
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:36b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 36
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:37b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 37
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:38b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 38
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:39b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 39
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:40b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 40
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:41b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 41
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:42b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 42
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:43b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 43
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:44b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 44
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:45b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 45
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:46b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 46
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:47b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 47
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot",Count:48b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] iron_ingot{CanDestroy:["#break"],HideFlags:8} 48
kill @e[scores={forge=2..},tag=pickup,type=item,nbt={Item:{id:"minecraft:iron_ingot"}}]

execute as @e[scores={forge=1},tag=pickup,nbt={Item:{id:"minecraft:emerald",Count:1b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] emerald{CanDestroy:["#break"],HideFlags:8} 1
execute as @e[scores={forge=1},tag=pickup,type=item,nbt={Item:{id:"minecraft:emerald",Count:48b}}] at @s if entity @a[distance=..2] run give @a[distance=..2] emerald{CanDestroy:["#break"],HideFlags:8} 2
kill @e[scores={forge=2..},tag=pickup,type=item,nbt={Item:{id:"minecraft:emerald"}}]

execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1199}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:diamond",Count:4b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=600}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:diamond",Count:4b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=diaF,tag=level2] at @s if entity @e[tag=timer,scores={forge=300}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:diamond",Count:4b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=900}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:diamond",Count:4b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=150}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:diamond",Count:4b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1199}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:emerald",Count:2b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=800}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:emerald",Count:2b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=400}] unless entity @e[type=item,distance=..2,nbt={Item:{id:"minecraft:emerald",Count:2b}}] run summon item ~ ~ ~ {Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}

execute as @e[tag=diaF] at @s unless entity @s[nbt={Marker:0b,DisabledSlots:4144959}] run data merge entity @s {Marker:0b,DisabledSlots:4144959}
execute as @e[tag=emeraldF] at @s unless entity @s[nbt={Marker:0b,DisabledSlots:4144959}] run data merge entity @s {Marker:0b,DisabledSlots:4144959}

execute as @e[tag=diaF,tag=level1,tag=!level3] at @s if entity @e[tag=timer,scores={forge=601}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 30s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1,tag=!level3] at @s if entity @e[tag=timer,scores={forge=801}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 20s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1000}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1020}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1040}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1060}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1080}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1100}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1120}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1140}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1160}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1180}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1199}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=600}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=580}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=560}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=540}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=520}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=500}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=480}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=460}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=440}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=420}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1] at @s if entity @e[tag=timer,scores={forge=400}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1,tag=!level3,tag=!level2] at @s if entity @e[tag=timer,scores={forge=200}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 20s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level1,tag=!level3,tag=!level2] at @s if entity @e[tag=timer,scores={forge=..1}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 30s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=301}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 15s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=901}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 15s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=..1}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 15s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=100}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=120}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=140}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=160}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=180}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=200}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=220}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=240}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=260}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=280}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=300}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=..1}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 12s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=50}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=70}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=90}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=110}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=130}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=150}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=170}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=190}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=210}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=230}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=250}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=900}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=880}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=860}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=840}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=820}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=800}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=780}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=760}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=740}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=720}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=700}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=diaF,tag=level3] at @s if entity @e[tag=timer,scores={forge=601}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Diamond Spawn In\",\"color\":\"gold\"},{\"text\":\" 15s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=emeraldF,tag=level1,tag=!level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=..1}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 60s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1,tag=!level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=200}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 50s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1,tag=!level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=400}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 40s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1,tag=!level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=600}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 30s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1,tag=!level3] at @s if entity @e[tag=timer,scores={forge=801}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 20s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=900}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=920}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=940}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=960}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=980}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1000}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1020}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1040}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1070}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1110}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level1] at @s if entity @e[tag=timer,scores={forge=1150}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=800}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=780}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=760}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=740}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=720}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=700}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=680}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=660}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=640}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=620}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2] at @s if entity @e[tag=timer,scores={forge=600}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=401}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 20s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=200}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 30s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level2,tag=!level3] at @s if entity @e[tag=timer,scores={forge=..1}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 40s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=400}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 0s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=380}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 1s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=360}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 2s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=340}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 3s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=320}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 4s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=300}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 5s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=280}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 6s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=260}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 7s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=240}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 8s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=220}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 9s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=200}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 10s\",\"color\":\"green\",\"bold\":\"true\"}]"}
execute as @e[tag=emeraldF,tag=level3] at @s if entity @e[tag=timer,scores={forge=..1}] run data merge entity @s {CustomNameVisible:1b,CustomName:"[{\"text\":\"Emerald Spawn In\",\"color\":\"gold\"},{\"text\":\" 20s\",\"color\":\"green\",\"bold\":\"true\"}]"}

execute as @e[type=armor_stand,tag=redS] at @s run spawnpoint @a[tag=red]
execute as @e[type=armor_stand,tag=blueS] at @s run spawnpoint @a[tag=blue]
execute as @e[type=armor_stand,tag=greenS] at @s run spawnpoint @a[tag=green]
execute as @e[type=armor_stand,tag=yellowS] at @s run spawnpoint @a[tag=yellow]
execute as @e[type=armor_stand,tag=grayS] at @s run spawnpoint @a[tag=gray]
execute as @e[type=armor_stand,tag=whiteS] at @s run spawnpoint @a[tag=white]
execute as @e[type=armor_stand,tag=aquaS] at @s run spawnpoint @a[tag=aqua]
execute as @e[type=armor_stand,tag=pinkS] at @s run spawnpoint @a[tag=pink]

execute as @a[tag=alive,scores={bwdeath=1}] at @s run gamemode spectator @s
execute as @a[tag=alive,scores={bwdeath=1..}] at @s run scoreboard players add @s death 1

### Drop Items Upon Death
execute as @a[scores={bwdeath=1..,death=1}] at @s unless entity @e[tag=dead,distance=..1] run summon armor_stand ~ ~ ~ {Marker:1b,Invisible:1b,Tags:["dead"]}
execute as @e[tag=dead] at @s unless entity @e[type=item,distance=..1.5,nbt={Item:{id:"minecraft:iron_ingot"}}] run summon item ~ ~ ~ {Item:{id:"minecraft:iron_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=dead] at @s unless entity @e[type=item,distance=..1.5,nbt={Item:{id:"minecraft:gold_ingot"}}] run summon item ~ ~ ~ {Item:{id:"minecraft:gold_ingot",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=dead] at @s unless entity @e[type=item,distance=..1.5,nbt={Item:{id:"minecraft:diamond"}}] run summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=dead] at @s unless entity @e[type=item,distance=..1.5,nbt={Item:{id:"minecraft:emerald"}}] run summon item ~ ~ ~ {Item:{id:"minecraft:emerald",Count:1b,tag:{CanDestroy:["#break"],HideFlags:8}}}
execute as @e[tag=dead] at @s store result entity @e[limit=1,type=item,distance=..1.5,nbt={Item:{id:"minecraft:emerald"}}] Item.Count byte 1 run scoreboard players get @a[limit=1,scores={bwdeath=1..,death=1}] emeraldCount
execute as @e[tag=dead] at @s store result entity @e[limit=1,type=item,distance=..1.5,nbt={Item:{id:"minecraft:iron_ingot"}}] Item.Count byte 1 run scoreboard players get @a[limit=1,scores={bwdeath=1..,death=1}] ironCount
execute as @e[tag=dead] at @s store result entity @e[limit=1,type=item,distance=..1.5,nbt={Item:{id:"minecraft:gold_ingot"}}] Item.Count byte 1 run scoreboard players get @a[limit=1,scores={bwdeath=1..,death=1}] goldCount
execute as @e[tag=dead] at @s store result entity @e[limit=1,type=item,distance=..1.5,nbt={Item:{id:"minecraft:diamond"}}] Item.Count byte 1 run scoreboard players get @a[limit=1,scores={bwdeath=1..,death=1}] diaCount
kill @e[tag=dead]

###Pickaxe Downgrade

scoreboard objectives add pick dummy

scoreboard players set @a[tag=diapick] pick 3
scoreboard players set @a[tag=ironpick] pick 2
scoreboard players set @a[tag=stonepick] pick 1
scoreboard players set @a[tag=woodpick] pick 0

execute as @a[scores={bwdeath=1..,death=5,pick=1}] at @s run give @s minecraft:wooden_pickaxe{CanDestroy:["#break"],HideFlags:12,Unbreakable:1b,Enchantments:[{id:"minecraft:efficiency",lvl:1}]} 1
execute as @a[scores={bwdeath=1..,death=5,pick=2}] at @s run give @s minecraft:stone_pickaxe{CanDestroy:["#break"],HideFlags:12,Unbreakable:1b,Enchantments:[{id:"minecraft:efficiency",lvl:2}]} 1
execute as @a[scores={bwdeath=1..,death=5,pick=3}] at @s run give @s minecraft:iron_pickaxe{CanDestroy:["#break"],HideFlags:12,Unbreakable:1b,Enchantments:[{id:"minecraft:efficiency",lvl:3}]} 1

execute as @a[scores={bwdeath=1..,death=5,pick=1}] at @s run tag @s add woodpick
execute as @a[scores={bwdeath=1..,death=5,pick=2}] at @s run tag @s add stonepick
execute as @a[scores={bwdeath=1..,death=5,pick=3}] at @s run tag @s add ironpick

###Axe Downgrade

scoreboard objectives add axe dummy

scoreboard players set @a[tag=diaaxe] axe 3
scoreboard players set @a[tag=ironaxe] axe 2
scoreboard players set @a[tag=stoneaxe] axe 1
scoreboard players set @a[tag=woodaxe] axe 0

execute as @a[scores={bwdeath=1..,death=5,axe=1}] at @s run give @s minecraft:wooden_axe{CanDestroy:["#break"],HideFlags:12,Unbreakable:1b,Enchantments:[{id:"minecraft:efficiency",lvl:1}]} 1
execute as @a[scores={bwdeath=1..,death=5,axe=2}] at @s run give @s minecraft:stone_axe{CanDestroy:["#break"],HideFlags:12,Unbreakable:1b,Enchantments:[{id:"minecraft:efficiency",lvl:2}]} 1
execute as @a[scores={bwdeath=1..,death=5,axe=3}] at @s run give @s minecraft:iron_axe{CanDestroy:["#break"],HideFlags:12,Unbreakable:1b,Enchantments:[{id:"minecraft:efficiency",lvl:3}]} 1

execute as @a[scores={bwdeath=1..,death=5,axe=1}] at @s run tag @s add woodaxe
execute as @a[scores={bwdeath=1..,death=5,axe=2}] at @s run tag @s add stoneaxe
execute as @a[scores={bwdeath=1..,death=5,axe=3}] at @s run tag @s add ironaxe

execute if entity @a[scores={bwdeath=1..}] run function bw:death


execute unless entity @a[tag=red] run scoreboard players add @e[type=armor_stand,tag=redB] eliminated 1
execute as @e[tag=redB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" Red Team","color":"dark_red"},{"text":" has been eliminated","color":"red"}]
execute unless entity @a[tag=blue] run scoreboard players add @e[type=armor_stand,tag=blueB] eliminated 1
execute as @e[tag=blueB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" Blue Team","color":"blue"},{"text":" has been eliminated","color":"red"}]
execute unless entity @a[tag=green] run scoreboard players add @e[type=armor_stand,tag=greenB] eliminated 1
execute as @e[tag=greenB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" Green Team","color":"green"},{"text":" has been eliminated","color":"red"}]
execute unless entity @a[tag=yellow] run scoreboard players add @e[type=armor_stand,tag=yellowB] eliminated 1
execute as @e[tag=yellowB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" Yellow Team","color":"yellow"},{"text":" has been eliminated","color":"red"}]
execute unless entity @a[tag=gray] run scoreboard players add @e[type=armor_stand,tag=grayB] eliminated 1
execute as @e[tag=grayB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" Gray Team","color":"gray"},{"text":" has been eliminated","color":"red"}]
execute unless entity @a[tag=white] run scoreboard players add @e[type=armor_stand,tag=whiteB] eliminated 1
execute as @e[tag=whiteB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" White Team","color":"white"},{"text":" has been eliminated","color":"red"}]
execute unless entity @a[tag=aqua] run scoreboard players add @e[type=armor_stand,tag=aquaB] eliminated 1
execute as @e[tag=aquaB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" Aqua Team","color":"aqua"},{"text":" has been eliminated","color":"red"}]
execute unless entity @a[tag=pink] run scoreboard players add @e[type=armor_stand,tag=pinkB] eliminated 1
execute as @e[tag=pinkB,type=armor_stand,scores={elimitnated=1}] run tellraw @a ["",{"text":"TEAM ELIMINATED >","bold":true,"color":"white"},{"text":" Pink Team","color":"pink"},{"text":" has been eliminated","color":"red"}]
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s iron_ingot
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s gold_ingot
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s emerald
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s diamond
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s egg
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s tnt
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s ender_pearl
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s #wool
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s oak_planks
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s end_stone
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s sandstone
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s obsidian
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s red_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s blue_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s lime_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s yellow_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s gray_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s white_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s light_blue_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s pink_stained_glass
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s stone_sword
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s iron_sword
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s diamond_sword
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s stone_pickaxe
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s iron_pickaxe
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s diamond_pickaxe
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s stone_axe
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s iron_axe
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s diamond_axe
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s golden_apple
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s potion
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s bow
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s arrow
execute as @a[scores={bwdeath=1,death=1..4}] at @s run clear @s snowball
execute as @a[scores={bwdeath=1}] at @s unless entity @s[nbt={Inventory:[{id:"minecraft:wooden_sword"}]}] run give @s minecraft:wooden_sword{CanDestroy:["#break"],HideFlags:14,Unbreakable:1b,AttributeModifiers:[{AttributeName:"generic.attackSpeed",Name:"generic.attackSpeed",Amount:10,Operation:0,UUIDLeast:954921,UUIDMost:548372},{AttributeName:"generic.attackDamage",Name:"generic.attackDamage",Amount:5,Operation:0,UUIDLeast:135599,UUIDMost:893074,Slot:"mainhand"}]} 1
scoreboard objectives add broke dummy
execute as @e[tag=bed] at @s unless block ~ ~ ~ cake run scoreboard players add @s broke 1
execute as @e[tag=redB,scores={broke=1}] at @s run title @a[tag=red] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=redB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=red] ~ ~ ~ 100 1
execute as @e[tag=blueB,scores={broke=1}] at @s run title @a[tag=blue] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=blueB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=blue] ~ ~ ~ 100 1
execute as @e[tag=greenB,scores={broke=1}] at @s run title @a[tag=green] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=greenB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=green] ~ ~ ~ 100 1
execute as @e[tag=yellowB,scores={broke=1}] at @s run title @a[tag=yellow] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=yellowB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=yellow] ~ ~ ~ 100 1
execute as @e[tag=grayB,scores={broke=1}] at @s run title @a[tag=gray] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=grayB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=gray] ~ ~ ~ 100 1
execute as @e[tag=whiteB,scores={broke=1}] at @s run title @a[tag=white] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=whiteB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=white] ~ ~ ~ 100 1
execute as @e[tag=aquaB,scores={broke=1}] at @s run title @a[tag=aqua] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=aquaB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=aqua] ~ ~ ~ 100 1
execute as @e[tag=pinkB,scores={broke=1}] at @s run title @a[tag=pink] title {"text":"Cake Destroyed","color":"red","bold":"true","italic":"true"}
execute as @e[tag=pinkB,scores={broke=1}] at @s run playsound minecraft:entity.wither.death master @a[tag=pink] ~ ~ ~ 100 1
execute as @e[tag=redB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" Red Cake","color":"dark_red"},{"text":" has been destroyed","color":"red"}]
execute as @e[tag=blueB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" Blue Cake","color":"dark_blue"},{"text":" has been destroyed","color":"red"}]
execute as @e[tag=greenB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" Green Cake","color":"green"},{"text":" has been destroyed","color":"red"}]
execute as @e[tag=yellowB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" Yellow Cake","color":"yellow"},{"text":" has been destroyed","color":"red"}]
execute as @e[tag=grayB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" Gray Cake","color":"gray"},{"text":" has been destroyed","color":"red"}]
execute as @e[tag=whiteB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" White Cake","color":"white"},{"text":" has been destroyed","color":"red"}]
execute as @e[tag=aquaB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" Aqua Cake","color":"aqua"},{"text":" has been destroyed","color":"red"}]
execute as @e[tag=pinkB,scores={broke=1}] at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=100..}] run tellraw @a ["",{"text":"CAKE DESTRUCTION >","bold":true,"color":"white"},{"text":" Pink Cake","color":"light_purple"},{"text":" has been destroyed","color":"red"}]
execute as @e[type=armor_stand,tag=redB] at @s unless entity @a[tag=red] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[type=armor_stand,tag=blueB] at @s unless entity @a[tag=blue] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[type=armor_stand,tag=greenB] at @s unless entity @a[tag=green] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[type=armor_stand,tag=yellowB] at @s unless entity @a[tag=yellow] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[type=armor_stand,tag=grayB] at @s unless entity @a[tag=gray] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[type=armor_stand,tag=whiteB] at @s unless entity @a[tag=white] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[type=armor_stand,tag=aquaB] at @s unless entity @a[tag=aqua] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[type=armor_stand,tag=pinkB] at @s unless entity @a[tag=pink] run fill ~ ~ ~ ~ ~ ~ air replace cake
execute as @e[tag=redB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=red,tag=!alive,scores={bwdeath=1..}] remove red
execute as @e[tag=blueB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=blue,tag=!alive,scores={bwdeath=1..}] remove blue
execute as @e[tag=greenB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=green,tag=!alive,scores={bwdeath=1..}] remove green
execute as @e[tag=yellowB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=yellow,tag=!alive,scores={bwdeath=1..}] remove yellow
execute as @e[tag=grayB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=gray,tag=!alive,scores={bwdeath=1..}] remove gray
execute as @e[tag=whiteB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=white,tag=!alive,scores={bwdeath=1..}] remove white
execute as @e[tag=aquaB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=aqua,tag=!alive,scores={bwdeath=1..}] remove aqua
execute as @e[tag=pinkB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=pink,tag=!alive,scores={bwdeath=1..}] remove pink
execute as @e[tag=redB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=red] remove alive
execute as @e[tag=blueB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=blue] remove alive
execute as @e[tag=greenB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=green] remove alive
execute as @e[tag=yellowB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=yellow] remove alive
execute as @e[tag=grayB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=gray] remove alive
execute as @e[tag=whiteB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=white] remove alive
execute as @e[tag=aquaB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=aqua] remove alive
execute as @e[tag=pinkB,scores={broke=1..}] at @s if entity @e[tag=timer,scores={gametimer=180..}] run tag @a[tag=pink] remove alive

execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=blue] unless entity @a[tag=green] unless entity @a[tag=yellow] unless entity @a[tag=gray] unless entity @a[tag=white] unless entity @a[tag=aqua] unless entity @a[tag=pink] run function bw:end
execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=red] unless entity @a[tag=green] unless entity @a[tag=yellow] unless entity @a[tag=gray] unless entity @a[tag=white] unless entity @a[tag=aqua] unless entity @a[tag=pink] run function bw:end
execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=blue] unless entity @a[tag=red] unless entity @a[tag=yellow] unless entity @a[tag=gray] unless entity @a[tag=white] unless entity @a[tag=aqua] unless entity @a[tag=pink] run function bw:end
execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=blue] unless entity @a[tag=green] unless entity @a[tag=red] unless entity @a[tag=gray] unless entity @a[tag=white] unless entity @a[tag=aqua] unless entity @a[tag=pink] run function bw:end
execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=blue] unless entity @a[tag=green] unless entity @a[tag=yellow] unless entity @a[tag=red] unless entity @a[tag=white] unless entity @a[tag=aqua] unless entity @a[tag=pink] run function bw:end
execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=blue] unless entity @a[tag=green] unless entity @a[tag=yellow] unless entity @a[tag=gray] unless entity @a[tag=red] unless entity @a[tag=aqua] unless entity @a[tag=pink] run function bw:end
execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=blue] unless entity @a[tag=green] unless entity @a[tag=yellow] unless entity @a[tag=gray] unless entity @a[tag=white] unless entity @a[tag=red] unless entity @a[tag=pink] run function bw:end
execute if entity @e[type=armor_stand,tag=timer,scores={gametimer=100..}] unless entity @a[tag=blue] unless entity @a[tag=green] unless entity @a[tag=yellow] unless entity @a[tag=gray] unless entity @a[tag=white] unless entity @a[tag=aqua] unless entity @a[tag=red] run function bw:end

execute as @a at @s unless entity @e[tag=clear,distance=..19] run summon armor_stand ~ ~ ~ {Tags:["clear"],NoGravity:1b,Invisible:1b,Marker:1b}
execute as @e[type=egg] at @s unless entity @e[tag=clear,distance=..14] run summon armor_stand ~ ~ ~ {Tags:["clear"],NoGravity:1b,Invisible:1b,Marker:1b}
execute as @a at @s if entity @e[tag=timer,scores={gametimer=..1}] run tag @e[tag=clear] add clear1
execute as @e[tag=clear1] at @s run fill ~15 ~15 ~15 ~-15 ~-15 ~-15 air replace #break

execute as @a at @s if entity @e[tag=timer,type=armor_stand,scores={gametimer=2}] run kill @e[tag=clear]
execute as @a[scores={tnt=1}] at @s run fill ~5 ~5 ~5 ~-5 ~-5 ~-5 redstone_block replace air
execute as @a[scores={tnt=1}] at @s run fill ~5 ~5 ~5 ~-5 ~-5 ~-5 air replace redstone_block
execute as @a[scores={tnt=1..}] at @s run scoreboard players reset @s tnt
execute as @e[type=tnt] at @s run tag @s add T
scoreboard players add @e[tag=T] forge 1
execute as @e[tag=T,scores={forge=50}] at @s run particle explosion ~ ~ ~ 1 1 1 1 0 force @a
execute as @e[tag=T,scores={forge=50}] at @s unless entity @e[tag=cTNT,distance=..1.3] run summon creeper ~ ~ ~ {Silent:1b,ActiveEffects:[{Id:25b,Amplifier:0b,Duration:2,ShowParticles:0b}],ExplosionRadius:7b,Invulnerable:1b,NoAI:1b,Fuse:0,CustomName:"{\"text\":\"tnt\"}",ignited:1b,Tags:["cTNT"]}
kill @e[tag=T,scores={forge=50}]
kill @e[type=area_effect_cloud]
execute as @e[tag=cTNT] at @s run particle explosion ~ ~ ~ 1 1 1 1 0 force @a
execute as @e[tag=cTNT] at @s run fill ~3 ~3 ~3 ~-3 ~-3 ~-3 air replace #wool
execute as @e[tag=cTNT] at @s run fill ~3 ~3 ~3 ~-3 ~-3 ~-3 air replace oak_planks
execute as @e[tag=cTNT] at @s run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 air replace end_stone
execute as @e[tag=cTNT] at @s run fill ~3 ~3 ~3 ~-3 ~-3 ~-3 air replace sandstone
execute as @e[tag=cTNT] at @s run playsound entity.generic.explode master @a[distance=..10] ~ ~ ~ 100 1
kill @e[tag=dup,scores={forge=10}]

execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=red,distance=..2] run tag @s add redg
execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=blue,distance=..2] run tag @s add blueg
execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=green,distance=..2] run tag @s add greeng
execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=yellow,distance=..2] run tag @s add yellowg
execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=gray,distance=..2] run tag @s add grayg
execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=white,distance=..2] run tag @s add whiteg
execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=aqua,distance=..2] run tag @s add aquag
execute as @e[type=egg] at @s unless entity @s[scores={forge=2..}] if entity @a[tag=pink,distance=..2] run tag @s add pinkg

execute as @e[type=egg,tag=redg] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 red_wool replace air
execute as @e[type=egg,tag=blueg] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 blue_wool replace air
execute as @e[type=egg,tag=greeng] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 green_wool replace air
execute as @e[type=egg,tag=yellowg] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 yellow_wool replace air
execute as @e[type=egg,tag=grayg] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 gray_wool replace air
execute as @e[type=egg,tag=whiteg] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 white_wool replace air
execute as @e[type=egg,tag=aquag] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 light_blue_wool replace air
execute as @e[type=egg,tag=pinkg] at @s run fill ^1 ^-2 ^ ^ ^-2 ^1 pink_wool replace air
scoreboard players add @e[type=egg] forge 1
kill @e[type=egg,scores={forge=40}]
kill @e[type=chicken]


execute as @e[tag=red,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=redB] add trap
execute as @e[tag=blue,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=blueB] add trap
execute as @e[tag=green,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=greenB] add trap
execute as @e[tag=yellow,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=yellowB] add trap
execute as @e[tag=gray,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=grayB] add trap
execute as @e[tag=white,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=whiteB] add trap
execute as @e[tag=aqua,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=aquaB] add trap
execute as @e[tag=pink,nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] at @s unless entity @s[nbt={SelectedItem:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}] run tag @e[tag=pinkB] add trap
execute as @e[tag=redB,tag=trap] at @s if entity @a[tag=!red,distance=..8,gamemode=!spectator] run title @a[tag=red] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"red","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=redB,tag=trap] at @s if entity @a[tag=!red,distance=..8,gamemode=!spectator] run effect give @a[tag=!red,distance=..8] blindness 5 1 true
execute as @e[tag=redB,tag=trap] at @s if entity @a[tag=!red,distance=..8] run playsound entity.endermen.teleport master @a[team=red] ~ ~ ~ 100 1
execute as @e[tag=redB,tag=trap] at @s if entity @a[tag=!red,distance=..8] run tag @s remove trap
execute as @e[tag=blueB,tag=trap] at @s if entity @a[tag=!blue,distance=..8,gamemode=!spectator] run title @a[tag=blue] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"blue","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=blueB,tag=trap] at @s if entity @a[tag=!blue,distance=..8,gamemode=!spectator] run effect give @a[tag=!blue,distance=..8] blindness 5 1 true
execute as @e[tag=blueB,tag=trap] at @s if entity @a[tag=!blue,distance=..8] run playsound entity.endermen.teleport master @a[team=blue] ~ ~ ~ 100 1
execute as @e[tag=blueB,tag=trap] at @s if entity @a[tag=!blue,distance=..8] run tag @s remove trap
execute as @e[tag=greenB,tag=trap] at @s if entity @a[tag=!green,distance=..8,gamemode=!spectator] run title @a[tag=green] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"green","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=greenB,tag=trap] at @s if entity @a[tag=!green,distance=..8,gamemode=!spectator] run effect give @a[tag=!green,distance=..8] blindness 5 1 true
execute as @e[tag=greenB,tag=trap] at @s if entity @a[tag=!green,distance=..8] run playsound entity.endermen.teleport master @a[team=green] ~ ~ ~ 100 1
execute as @e[tag=greenB,tag=trap] at @s if entity @a[tag=!green,distance=..8] run tag @s remove trap
execute as @e[tag=yellowB,tag=trap] at @s if entity @a[tag=!yellow,distance=..8,gamemode=!spectator] run title @a[tag=yellow] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"yellow","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=yellowB,tag=trap] at @s if entity @a[tag=!yellow,distance=..8,gamemode=!spectator] run effect give @a[tag=!yellow,distance=..8] blindness 5 1 true
execute as @e[tag=yellowB,tag=trap] at @s if entity @a[tag=!yellow,distance=..8] run playsound entity.endermen.teleport master @a[team=yellow] ~ ~ ~ 100 1
execute as @e[tag=yellowB,tag=trap] at @s if entity @a[tag=!yellow,distance=..8] run tag @s remove trap
execute as @e[tag=grayB,tag=trap] at @s if entity @a[tag=!gray,distance=..8,gamemode=!spectator] run title @a[tag=gray] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"gray","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=grayB,tag=trap] at @s if entity @a[tag=!gray,distance=..8,gamemode=!spectator] run effect give @a[tag=!gray,distance=..8] blindness 5 1 true
execute as @e[tag=grayB,tag=trap] at @s if entity @a[tag=!gray,distance=..8] run playsound entity.endermen.teleport master @a[team=gray] ~ ~ ~ 100 1
execute as @e[tag=grayB,tag=trap] at @s if entity @a[tag=!gray,distance=..8] run tag @s remove trap
execute as @e[tag=whiteB,tag=trap] at @s if entity @a[tag=!white,distance=..8,gamemode=!spectator] run title @a[tag=white] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"white","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=whiteB,tag=trap] at @s if entity @a[tag=!white,distance=..8,gamemode=!spectator] run effect give @a[tag=!white,distance=..8] blindness 5 1 true
execute as @e[tag=whiteB,tag=trap] at @s if entity @a[tag=!white,distance=..8] run playsound entity.endermen.teleport master @a[team=white] ~ ~ ~ 100 1
execute as @e[tag=whiteB,tag=trap] at @s if entity @a[tag=!white,distance=..8] run tag @s remove trap
execute as @e[tag=aquaB,tag=trap] at @s if entity @a[tag=!aqua,distance=..8,gamemode=!spectator] run title @a[tag=aqua] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"aqua","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=aquaB,tag=trap] at @s if entity @a[tag=!aqua,distance=..8,gamemode=!spectator] run effect give @a[tag=!aqua,distance=..8] blindness 5 1 true
execute as @e[tag=aquaB,tag=trap] at @s if entity @a[tag=!aqua,distance=..8] run playsound entity.endermen.teleport master @a[team=aqua] ~ ~ ~ 100 1
execute as @e[tag=aquaB,tag=trap] at @s if entity @a[tag=!aqua,distance=..8] run tag @s remove trap
execute as @e[tag=pinkB,tag=trap] at @s if entity @a[tag=!pink,distance=..8,gamemode=!spectator] run title @a[tag=pink] title [{"text":"Your","color":"white","bold":"true"},{"text":"Trap ","color":"pink","bold":"true"},{"text":"Has Been Set Off","color":"white","bold":"true"}]
execute as @e[tag=pinkB,tag=trap] at @s if entity @a[tag=!pink,distance=..8,gamemode=!spectator] run effect give @a[tag=!pink,distance=..8] blindness 5 1 true
execute as @e[tag=pinkB,tag=trap] at @s if entity @a[tag=!pink,distance=..8] run playsound entity.endermen.teleport master @a[team=pink] ~ ~ ~ 100 1
execute as @e[tag=pinkB,tag=trap] at @s if entity @a[tag=!pink,distance=..8] run tag @s remove trap
enchant @a[tag=sharp] sharpness 1

execute if entity @a[nbt={Inventory:[{id:"minecraft:golden_sword"}]}] run function bw:up
execute if entity @a[nbt={Inventory:[{id:"minecraft:tripwire_hook"}]}] run function bw:up
execute if entity @a[nbt={Inventory:[{id:"minecraft:golden_chestplate"}]}] run function bw:up
execute if entity @a[nbt={Inventory:[{id:"minecraft:chainmail_chestplate"}]}] run function bw:up
execute if entity @a[nbt={Inventory:[{id:"minecraft:iron_chestplate"}]}] run function bw:up
execute if entity @a[nbt={Inventory:[{id:"minecraft:diamond_chestplate"}]}] run function bw:up

execute as @a[tag=red,tag=ironf] at @s run tag @e[tag=redF] add level2
execute as @a[tag=red,tag=goldf] at @s run tag @e[tag=redF] add level3
execute as @a[tag=red,tag=emf] at @s run tag @e[tag=redF] add level4

execute as @a[tag=blue,tag=ironf] at @s run tag @e[tag=blueF] add level2
execute as @a[tag=blue,tag=goldf] at @s run tag @e[tag=blueF] add level3
execute as @a[tag=blue,tag=emf] at @s run tag @e[tag=blueF] add level4

execute as @a[tag=green,tag=ironf] at @s run tag @e[tag=greenF] add level2
execute as @a[tag=green,tag=goldf] at @s run tag @e[tag=greenF] add level3
execute as @a[tag=green,tag=emf] at @s run tag @e[tag=greenF] add level4

execute as @a[tag=yellow,tag=ironf] at @s run tag @e[tag=yellowF] add level2
execute as @a[tag=yellow,tag=goldf] at @s run tag @e[tag=yellowF] add level3
execute as @a[tag=yellow,tag=emf] at @s run tag @e[tag=yellowF] add level4

execute as @a[tag=gray,tag=ironf] at @s run tag @e[tag=grayF] add level2
execute as @a[tag=gray,tag=goldf] at @s run tag @e[tag=grayF] add level3
execute as @a[tag=gray,tag=emf] at @s run tag @e[tag=grayF] add level4

execute as @a[tag=white,tag=ironf] at @s run tag @e[tag=whiteF] add level2
execute as @a[tag=white,tag=goldf] at @s run tag @e[tag=whiteF] add level3
execute as @a[tag=white,tag=emf] at @s run tag @e[tag=whiteF] add level4

execute as @a[tag=aqua,tag=ironf] at @s run tag @e[tag=aquaF] add level2
execute as @a[tag=aqua,tag=goldf] at @s run tag @e[tag=aquaF] add level3
execute as @a[tag=aqua,tag=emf] at @s run tag @e[tag=aquaF] add level4

execute as @a[tag=pink,tag=ironf] at @s run tag @e[tag=pinkF] add level2
execute as @a[tag=pink,tag=goldf] at @s run tag @e[tag=pinkF] add level3
execute as @a[tag=pink,tag=emf] at @s run tag @e[tag=pinkF] add level4

clear @a[gamemode=adventure] glass_bottle


execute as @e[type=item,nbt={Item:{id:"minecraft:oak_planks"}}] at @s run data merge entity @s {Item:{id:"minecraft:oak_planks",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:obsidian"}}] at @s run data merge entity @s {Item:{id:"minecraft:obsidian",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:red_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:red_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:blue_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:blue_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:lime_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:lime_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:yellow_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:yellow_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:gray_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:gray_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:white_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:white_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:light_blue_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:light_blue_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:pink_wool"}}] at @s run data merge entity @s {Item:{id:"minecraft:pink_wool",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:red_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:red_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:blue_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:blue_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:lime_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:lime_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:yellow_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:yellow_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:gray_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:gray_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:white_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:white_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:light_blue_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:light_blue_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:pink_stained_glass"}}] at @s run data merge entity @s {Item:{id:"minecraft:pink_stained_glass",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:sandstone"}}] at @s run data merge entity @s {Item:{id:"minecraft:sandstone",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

execute as @e[type=item,nbt={Item:{id:"minecraft:end_stone"}}] at @s run data merge entity @s {Item:{id:"minecraft:end_stone",tag:{CanDestroy:["#break"],CanPlaceOn:["#place"],HideFlags:24}}}

### SCOREBOARD CHANGE DETECTION 

scoreboard objectives add change dummy
execute if entity @e[tag=redB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=blueB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=greenB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=yellowB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=grayB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=whiteB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=aquaB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=pinkB,scores={broke=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={gametimer=100}] run scoreboard players add @e[tag=timer] change 1

scoreboard objectives add player5 dummy
scoreboard objectives add player4 dummy
scoreboard objectives add player3 dummy
scoreboard objectives add player2 dummy
scoreboard objectives add player1 dummy
scoreboard objectives add player0 dummy

execute if score #red forge matches 5.. run scoreboard players add #red player5 1
execute if score #red forge matches 4 run scoreboard players add #red player4 1
execute if score #red forge matches 3 run scoreboard players add #red player3 1
execute if score #red forge matches 2 run scoreboard players add #red player2 1
execute if score #red forge matches 1 run scoreboard players add #red player1 1
execute if score #red forge matches 0 run scoreboard players add #red player0 1

execute if score #red forge matches 5.. run scoreboard players reset #red player4
execute if score #red forge matches 5.. run scoreboard players reset #red player3
execute if score #red forge matches 5.. run scoreboard players reset #red player2
execute if score #red forge matches 5.. run scoreboard players reset #red player1
execute if score #red forge matches 5.. run scoreboard players reset #red player0

execute if score #red forge matches 4 run scoreboard players reset #red player5
execute if score #red forge matches 4 run scoreboard players reset #red player3
execute if score #red forge matches 4 run scoreboard players reset #red player2
execute if score #red forge matches 4 run scoreboard players reset #red player1
execute if score #red forge matches 4 run scoreboard players reset #red player0

execute if score #red forge matches 3 run scoreboard players reset #red player5
execute if score #red forge matches 3 run scoreboard players reset #red player4
execute if score #red forge matches 3 run scoreboard players reset #red player2
execute if score #red forge matches 3 run scoreboard players reset #red player1
execute if score #red forge matches 3 run scoreboard players reset #red player0

execute if score #red forge matches 2 run scoreboard players reset #red player5
execute if score #red forge matches 2 run scoreboard players reset #red player3
execute if score #red forge matches 2 run scoreboard players reset #red player4
execute if score #red forge matches 2 run scoreboard players reset #red player1
execute if score #red forge matches 2 run scoreboard players reset #red player0

execute if score #red forge matches 1 run scoreboard players reset #red player5
execute if score #red forge matches 1 run scoreboard players reset #red player3
execute if score #red forge matches 1 run scoreboard players reset #red player2
execute if score #red forge matches 1 run scoreboard players reset #red player4
execute if score #red forge matches 1 run scoreboard players reset #red player0

execute if score #red forge matches 0 run scoreboard players reset #red player5
execute if score #red forge matches 0 run scoreboard players reset #red player3
execute if score #red forge matches 0 run scoreboard players reset #red player2
execute if score #red forge matches 0 run scoreboard players reset #red player1
execute if score #red forge matches 0 run scoreboard players reset #red player4

execute if score #blue forge matches 5.. run scoreboard players add #blue player5 1
execute if score #blue forge matches 4 run scoreboard players add #blue player4 1
execute if score #blue forge matches 3 run scoreboard players add #blue player3 1
execute if score #blue forge matches 2 run scoreboard players add #blue player2 1
execute if score #blue forge matches 1 run scoreboard players add #blue player1 1
execute if score #blue forge matches 0 run scoreboard players add #blue player0 1

execute if score #blue forge matches 5.. run scoreboard players reset #blue player4
execute if score #blue forge matches 5.. run scoreboard players reset #blue player3
execute if score #blue forge matches 5.. run scoreboard players reset #blue player2
execute if score #blue forge matches 5.. run scoreboard players reset #blue player1
execute if score #blue forge matches 5.. run scoreboard players reset #blue player0

execute if score #blue forge matches 4 run scoreboard players reset #blue player5
execute if score #blue forge matches 4 run scoreboard players reset #blue player3
execute if score #blue forge matches 4 run scoreboard players reset #blue player2
execute if score #blue forge matches 4 run scoreboard players reset #blue player1
execute if score #blue forge matches 4 run scoreboard players reset #blue player0

execute if score #blue forge matches 3 run scoreboard players reset #blue player5
execute if score #blue forge matches 3 run scoreboard players reset #blue player4
execute if score #blue forge matches 3 run scoreboard players reset #blue player2
execute if score #blue forge matches 3 run scoreboard players reset #blue player1
execute if score #blue forge matches 3 run scoreboard players reset #blue player0

execute if score #blue forge matches 2 run scoreboard players reset #blue player5
execute if score #blue forge matches 2 run scoreboard players reset #blue player3
execute if score #blue forge matches 2 run scoreboard players reset #blue player4
execute if score #blue forge matches 2 run scoreboard players reset #blue player1
execute if score #blue forge matches 2 run scoreboard players reset #blue player0

execute if score #blue forge matches 1 run scoreboard players reset #blue player5
execute if score #blue forge matches 1 run scoreboard players reset #blue player3
execute if score #blue forge matches 1 run scoreboard players reset #blue player2
execute if score #blue forge matches 1 run scoreboard players reset #blue player4
execute if score #blue forge matches 1 run scoreboard players reset #blue player0

execute if score #blue forge matches 0 run scoreboard players reset #blue player5
execute if score #blue forge matches 0 run scoreboard players reset #blue player3
execute if score #blue forge matches 0 run scoreboard players reset #blue player2
execute if score #blue forge matches 0 run scoreboard players reset #blue player1
execute if score #blue forge matches 0 run scoreboard players reset #blue player4

execute if score #green forge matches 5.. run scoreboard players add #green player5 1
execute if score #green forge matches 4 run scoreboard players add #green player4 1
execute if score #green forge matches 3 run scoreboard players add #green player3 1
execute if score #green forge matches 2 run scoreboard players add #green player2 1
execute if score #green forge matches 1 run scoreboard players add #green player1 1
execute if score #green forge matches 0 run scoreboard players add #green player0 1

execute if score #green forge matches 5.. run scoreboard players reset #green player4
execute if score #green forge matches 5.. run scoreboard players reset #green player3
execute if score #green forge matches 5.. run scoreboard players reset #green player2
execute if score #green forge matches 5.. run scoreboard players reset #green player1
execute if score #green forge matches 5.. run scoreboard players reset #green player0

execute if score #green forge matches 4 run scoreboard players reset #green player5
execute if score #green forge matches 4 run scoreboard players reset #green player3
execute if score #green forge matches 4 run scoreboard players reset #green player2
execute if score #green forge matches 4 run scoreboard players reset #green player1
execute if score #green forge matches 4 run scoreboard players reset #green player0

execute if score #green forge matches 3 run scoreboard players reset #green player5
execute if score #green forge matches 3 run scoreboard players reset #green player4
execute if score #green forge matches 3 run scoreboard players reset #green player2
execute if score #green forge matches 3 run scoreboard players reset #green player1
execute if score #green forge matches 3 run scoreboard players reset #green player0

execute if score #green forge matches 2 run scoreboard players reset #green player5
execute if score #green forge matches 2 run scoreboard players reset #green player3
execute if score #green forge matches 2 run scoreboard players reset #green player4
execute if score #green forge matches 2 run scoreboard players reset #green player1
execute if score #green forge matches 2 run scoreboard players reset #green player0

execute if score #green forge matches 1 run scoreboard players reset #green player5
execute if score #green forge matches 1 run scoreboard players reset #green player3
execute if score #green forge matches 1 run scoreboard players reset #green player2
execute if score #green forge matches 1 run scoreboard players reset #green player4
execute if score #green forge matches 1 run scoreboard players reset #green player0

execute if score #green forge matches 0 run scoreboard players reset #green player5
execute if score #green forge matches 0 run scoreboard players reset #green player3
execute if score #green forge matches 0 run scoreboard players reset #green player2
execute if score #green forge matches 0 run scoreboard players reset #green player1
execute if score #green forge matches 0 run scoreboard players reset #green player4

execute if score #yellow forge matches 5.. run scoreboard players add #yellow player5 1
execute if score #yellow forge matches 4 run scoreboard players add #yellow player4 1
execute if score #yellow forge matches 3 run scoreboard players add #yellow player3 1
execute if score #yellow forge matches 2 run scoreboard players add #yellow player2 1
execute if score #yellow forge matches 1 run scoreboard players add #yellow player1 1
execute if score #yellow forge matches 0 run scoreboard players add #yellow player0 1

execute if score #yellow forge matches 5.. run scoreboard players reset #yellow player4
execute if score #yellow forge matches 5.. run scoreboard players reset #yellow player3
execute if score #yellow forge matches 5.. run scoreboard players reset #yellow player2
execute if score #yellow forge matches 5.. run scoreboard players reset #yellow player1
execute if score #yellow forge matches 5.. run scoreboard players reset #yellow player0

execute if score #yellow forge matches 4 run scoreboard players reset #yellow player5
execute if score #yellow forge matches 4 run scoreboard players reset #yellow player3
execute if score #yellow forge matches 4 run scoreboard players reset #yellow player2
execute if score #yellow forge matches 4 run scoreboard players reset #yellow player1
execute if score #yellow forge matches 4 run scoreboard players reset #yellow player0

execute if score #yellow forge matches 3 run scoreboard players reset #yellow player5
execute if score #yellow forge matches 3 run scoreboard players reset #yellow player4
execute if score #yellow forge matches 3 run scoreboard players reset #yellow player2
execute if score #yellow forge matches 3 run scoreboard players reset #yellow player1
execute if score #yellow forge matches 3 run scoreboard players reset #yellow player0

execute if score #yellow forge matches 2 run scoreboard players reset #yellow player5
execute if score #yellow forge matches 2 run scoreboard players reset #yellow player3
execute if score #yellow forge matches 2 run scoreboard players reset #yellow player4
execute if score #yellow forge matches 2 run scoreboard players reset #yellow player1
execute if score #yellow forge matches 2 run scoreboard players reset #yellow player0

execute if score #yellow forge matches 1 run scoreboard players reset #yellow player5
execute if score #yellow forge matches 1 run scoreboard players reset #yellow player3
execute if score #yellow forge matches 1 run scoreboard players reset #yellow player2
execute if score #yellow forge matches 1 run scoreboard players reset #yellow player4
execute if score #yellow forge matches 1 run scoreboard players reset #yellow player0

execute if score #yellow forge matches 0 run scoreboard players reset #yellow player5
execute if score #yellow forge matches 0 run scoreboard players reset #yellow player3
execute if score #yellow forge matches 0 run scoreboard players reset #yellow player2
execute if score #yellow forge matches 0 run scoreboard players reset #yellow player1
execute if score #yellow forge matches 0 run scoreboard players reset #yellow player4

execute if score #gray forge matches 5.. run scoreboard players add #gray player5 1
execute if score #gray forge matches 4 run scoreboard players add #gray player4 1
execute if score #gray forge matches 3 run scoreboard players add #gray player3 1
execute if score #gray forge matches 2 run scoreboard players add #gray player2 1
execute if score #gray forge matches 1 run scoreboard players add #gray player1 1
execute if score #gray forge matches 0 run scoreboard players add #gray player0 1

execute if score #gray forge matches 5.. run scoreboard players reset #gray player4
execute if score #gray forge matches 5.. run scoreboard players reset #gray player3
execute if score #gray forge matches 5.. run scoreboard players reset #gray player2
execute if score #gray forge matches 5.. run scoreboard players reset #gray player1
execute if score #gray forge matches 5.. run scoreboard players reset #gray player0

execute if score #gray forge matches 4 run scoreboard players reset #gray player5
execute if score #gray forge matches 4 run scoreboard players reset #gray player3
execute if score #gray forge matches 4 run scoreboard players reset #gray player2
execute if score #gray forge matches 4 run scoreboard players reset #gray player1
execute if score #gray forge matches 4 run scoreboard players reset #gray player0

execute if score #gray forge matches 3 run scoreboard players reset #gray player5
execute if score #gray forge matches 3 run scoreboard players reset #gray player4
execute if score #gray forge matches 3 run scoreboard players reset #gray player2
execute if score #gray forge matches 3 run scoreboard players reset #gray player1
execute if score #gray forge matches 3 run scoreboard players reset #gray player0

execute if score #gray forge matches 2 run scoreboard players reset #gray player5
execute if score #gray forge matches 2 run scoreboard players reset #gray player3
execute if score #gray forge matches 2 run scoreboard players reset #gray player4
execute if score #gray forge matches 2 run scoreboard players reset #gray player1
execute if score #gray forge matches 2 run scoreboard players reset #gray player0

execute if score #gray forge matches 1 run scoreboard players reset #gray player5
execute if score #gray forge matches 1 run scoreboard players reset #gray player3
execute if score #gray forge matches 1 run scoreboard players reset #gray player2
execute if score #gray forge matches 1 run scoreboard players reset #gray player4
execute if score #gray forge matches 1 run scoreboard players reset #gray player0

execute if score #gray forge matches 0 run scoreboard players reset #gray player5
execute if score #gray forge matches 0 run scoreboard players reset #gray player3
execute if score #gray forge matches 0 run scoreboard players reset #gray player2
execute if score #gray forge matches 0 run scoreboard players reset #gray player1
execute if score #gray forge matches 0 run scoreboard players reset #gray player4

execute if score #white forge matches 5.. run scoreboard players add #white player5 1
execute if score #white forge matches 4 run scoreboard players add #white player4 1
execute if score #white forge matches 3 run scoreboard players add #white player3 1
execute if score #white forge matches 2 run scoreboard players add #white player2 1
execute if score #white forge matches 1 run scoreboard players add #white player1 1
execute if score #white forge matches 0 run scoreboard players add #white player0 1

execute if score #white forge matches 5.. run scoreboard players reset #white player4
execute if score #white forge matches 5.. run scoreboard players reset #white player3
execute if score #white forge matches 5.. run scoreboard players reset #white player2
execute if score #white forge matches 5.. run scoreboard players reset #white player1
execute if score #white forge matches 5.. run scoreboard players reset #white player0

execute if score #white forge matches 4 run scoreboard players reset #white player5
execute if score #white forge matches 4 run scoreboard players reset #white player3
execute if score #white forge matches 4 run scoreboard players reset #white player2
execute if score #white forge matches 4 run scoreboard players reset #white player1
execute if score #white forge matches 4 run scoreboard players reset #white player0

execute if score #white forge matches 3 run scoreboard players reset #white player5
execute if score #white forge matches 3 run scoreboard players reset #white player4
execute if score #white forge matches 3 run scoreboard players reset #white player2
execute if score #white forge matches 3 run scoreboard players reset #white player1
execute if score #white forge matches 3 run scoreboard players reset #white player0

execute if score #white forge matches 2 run scoreboard players reset #white player5
execute if score #white forge matches 2 run scoreboard players reset #white player3
execute if score #white forge matches 2 run scoreboard players reset #white player4
execute if score #white forge matches 2 run scoreboard players reset #white player1
execute if score #white forge matches 2 run scoreboard players reset #white player0

execute if score #white forge matches 1 run scoreboard players reset #white player5
execute if score #white forge matches 1 run scoreboard players reset #white player3
execute if score #white forge matches 1 run scoreboard players reset #white player2
execute if score #white forge matches 1 run scoreboard players reset #white player4
execute if score #white forge matches 1 run scoreboard players reset #white player0

execute if score #white forge matches 0 run scoreboard players reset #white player5
execute if score #white forge matches 0 run scoreboard players reset #white player3
execute if score #white forge matches 0 run scoreboard players reset #white player2
execute if score #white forge matches 0 run scoreboard players reset #white player1
execute if score #white forge matches 0 run scoreboard players reset #white player4

execute if score #aqua forge matches 5.. run scoreboard players add #aqua player5 1
execute if score #aqua forge matches 4 run scoreboard players add #aqua player4 1
execute if score #aqua forge matches 3 run scoreboard players add #aqua player3 1
execute if score #aqua forge matches 2 run scoreboard players add #aqua player2 1
execute if score #aqua forge matches 1 run scoreboard players add #aqua player1 1
execute if score #aqua forge matches 0 run scoreboard players add #aqua player0 1

execute if score #aqua forge matches 5.. run scoreboard players reset #aqua player4
execute if score #aqua forge matches 5.. run scoreboard players reset #aqua player3
execute if score #aqua forge matches 5.. run scoreboard players reset #aqua player2
execute if score #aqua forge matches 5.. run scoreboard players reset #aqua player1
execute if score #aqua forge matches 5.. run scoreboard players reset #aqua player0

execute if score #aqua forge matches 4 run scoreboard players reset #aqua player5
execute if score #aqua forge matches 4 run scoreboard players reset #aqua player3
execute if score #aqua forge matches 4 run scoreboard players reset #aqua player2
execute if score #aqua forge matches 4 run scoreboard players reset #aqua player1
execute if score #aqua forge matches 4 run scoreboard players reset #aqua player0

execute if score #aqua forge matches 3 run scoreboard players reset #aqua player5
execute if score #aqua forge matches 3 run scoreboard players reset #aqua player4
execute if score #aqua forge matches 3 run scoreboard players reset #aqua player2
execute if score #aqua forge matches 3 run scoreboard players reset #aqua player1
execute if score #aqua forge matches 3 run scoreboard players reset #aqua player0

execute if score #aqua forge matches 2 run scoreboard players reset #aqua player5
execute if score #aqua forge matches 2 run scoreboard players reset #aqua player3
execute if score #aqua forge matches 2 run scoreboard players reset #aqua player4
execute if score #aqua forge matches 2 run scoreboard players reset #aqua player1
execute if score #aqua forge matches 2 run scoreboard players reset #aqua player0

execute if score #aqua forge matches 1 run scoreboard players reset #aqua player5
execute if score #aqua forge matches 1 run scoreboard players reset #aqua player3
execute if score #aqua forge matches 1 run scoreboard players reset #aqua player2
execute if score #aqua forge matches 1 run scoreboard players reset #aqua player4
execute if score #aqua forge matches 1 run scoreboard players reset #aqua player0

execute if score #aqua forge matches 0 run scoreboard players reset #aqua player5
execute if score #aqua forge matches 0 run scoreboard players reset #aqua player3
execute if score #aqua forge matches 0 run scoreboard players reset #aqua player2
execute if score #aqua forge matches 0 run scoreboard players reset #aqua player1
execute if score #aqua forge matches 0 run scoreboard players reset #aqua player4

execute if score #pink forge matches 5.. run scoreboard players add #pink player5 1
execute if score #pink forge matches 4 run scoreboard players add #pink player4 1
execute if score #pink forge matches 3 run scoreboard players add #pink player3 1
execute if score #pink forge matches 2 run scoreboard players add #pink player2 1
execute if score #pink forge matches 1 run scoreboard players add #pink player1 1
execute if score #pink forge matches 0 run scoreboard players add #pink player0 1

execute if score #pink forge matches 5.. run scoreboard players reset #pink player4
execute if score #pink forge matches 5.. run scoreboard players reset #pink player3
execute if score #pink forge matches 5.. run scoreboard players reset #pink player2
execute if score #pink forge matches 5.. run scoreboard players reset #pink player1
execute if score #pink forge matches 5.. run scoreboard players reset #pink player0

execute if score #pink forge matches 4 run scoreboard players reset #pink player5
execute if score #pink forge matches 4 run scoreboard players reset #pink player3
execute if score #pink forge matches 4 run scoreboard players reset #pink player2
execute if score #pink forge matches 4 run scoreboard players reset #pink player1
execute if score #pink forge matches 4 run scoreboard players reset #pink player0

execute if score #pink forge matches 3 run scoreboard players reset #pink player5
execute if score #pink forge matches 3 run scoreboard players reset #pink player4
execute if score #pink forge matches 3 run scoreboard players reset #pink player2
execute if score #pink forge matches 3 run scoreboard players reset #pink player1
execute if score #pink forge matches 3 run scoreboard players reset #pink player0

execute if score #pink forge matches 2 run scoreboard players reset #pink player5
execute if score #pink forge matches 2 run scoreboard players reset #pink player3
execute if score #pink forge matches 2 run scoreboard players reset #pink player4
execute if score #pink forge matches 2 run scoreboard players reset #pink player1
execute if score #pink forge matches 2 run scoreboard players reset #pink player0

execute if score #pink forge matches 1 run scoreboard players reset #pink player5
execute if score #pink forge matches 1 run scoreboard players reset #pink player3
execute if score #pink forge matches 1 run scoreboard players reset #pink player2
execute if score #pink forge matches 1 run scoreboard players reset #pink player4
execute if score #pink forge matches 1 run scoreboard players reset #pink player0

execute if score #pink forge matches 0 run scoreboard players reset #pink player5
execute if score #pink forge matches 0 run scoreboard players reset #pink player3
execute if score #pink forge matches 0 run scoreboard players reset #pink player2
execute if score #pink forge matches 0 run scoreboard players reset #pink player1
execute if score #pink forge matches 0 run scoreboard players reset #pink player4

execute if score #red player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #red player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #red player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #red player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #red player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #red player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if score #blue player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #blue player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #blue player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #blue player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #blue player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #blue player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if score #green player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #green player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #green player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #green player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #green player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #green player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if score #yellow player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #yellow player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #yellow player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #yellow player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #yellow player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #yellow player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if score #gray player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #gray player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #gray player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #gray player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #gray player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #gray player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if score #white player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #white player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #white player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #white player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #white player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #white player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if score #aqua player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #aqua player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #aqua player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #aqua player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #aqua player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #aqua player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if score #pink player5 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #pink player4 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #pink player3 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #pink player2 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #pink player1 matches 1 run scoreboard players add @e[tag=timer] change 1
execute if score #pink player0 matches 1 run scoreboard players add @e[tag=timer] change 1

execute if entity @e[tag=timer,scores={gametimer=1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={gametimer=100}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={gametimer=9601}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={gametimer=19201}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={gametimer=28801}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={gametimer=38401}] run scoreboard players add @e[tag=timer] change 1

execute if entity @e[tag=timer,scores={event=..1}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=2}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=1201}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=2401}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=3601}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=4801}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=6001}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=7201}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,scores={event=8401}] run scoreboard players add @e[tag=timer] change 1

execute if entity @e[tag=timer,type=armor_stand,scores={event=8421}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8441}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8461}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8481}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8501}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8521}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8541}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8561}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8581}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8601}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8621}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8641}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8661}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8681}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8701}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8721}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8741}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8761}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8781}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8801}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8821}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8841}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8861}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8881}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8901}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8921}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8941}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8961}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=8981}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9001}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9021}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9041}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9061}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9081}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9101}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9121}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9141}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9161}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9181}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9201}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9221}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9241}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9261}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9281}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9301}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9321}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9341}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9361}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9381}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9401}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9421}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9441}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9461}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9481}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9501}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9521}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9541}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9561}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9581}] run scoreboard players add @e[tag=timer] change 1
execute if entity @e[tag=timer,type=armor_stand,scores={event=9601}] run scoreboard players add @e[tag=timer] change 1


###

execute if entity @e[tag=timer,scores={change=1..}] run scoreboard objectives remove sidebar
execute if entity @e[tag=timer,scores={change=1..}] run scoreboard objectives add sidebar dummy {"text":"CAKEWARS","color":"yellow","bold":true}
scoreboard objectives setdisplay sidebar sidebar
execute if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7by_Miles_Playz sidebar 15

execute as @a if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7~~~~~~~~~~~ sidebar 14

execute if entity @e[tag=timer,scores={gametimer=..99}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set _ sidebar 13
execute if entity @e[tag=timer,scores={gametimer=100..9600}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §bDiamondII: sidebar 13
execute if entity @e[tag=timer,scores={gametimer=9601..19200}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2EmeraldII: sidebar 13
execute if entity @e[tag=timer,scores={gametimer=19201..28800}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §bDiamondIII: sidebar 13
execute if entity @e[tag=timer,scores={gametimer=28801..38400}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2EmeraldIII: sidebar 13
execute if entity @e[tag=timer,scores={gametimer=38401..}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set _ sidebar 13

execute as @a if entity @e[tag=timer,type=armor_stand,scores={gametimer=38401..}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set _ sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=..0}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=1..1200}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a8:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=1201..2400}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a7:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=2401..3600}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a6:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=3601..4800}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a5:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=4801..6000}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a4:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=6001..7200}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a3:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=7201..8400}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a2:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8401..8420}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a1:00 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8421..8440}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:59 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8441..8460}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:58 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8461..8480}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:57 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8481..8500}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:56 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8501..8520}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:55 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8521..8540}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:54 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8541..8560}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:53 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8561..8580}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:52 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8581..8600}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:51 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8601..8620}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:50 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8621..8640}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:49 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8641..8660}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:48 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8661..8680}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:47 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8681..8700}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:46 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8701..8720}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:45 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8721..8740}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:44 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8741..8760}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:43 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8761..8780}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:42 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8781..8800}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:41 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8801..8820}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:40 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8821..8840}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:39 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8841..8860}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:38 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8861..8880}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:37 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8881..8900}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:36 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8901..8920}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:35 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8921..8940}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:34 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8941..8960}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:33 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8961..8980}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:32 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=8981..9000}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:31 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9001..9020}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:30 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9021..9040}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:29 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9041..9060}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:28 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9061..9080}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:27 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9081..9100}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:26 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9101..9120}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:25 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9121..9140}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:24 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9141..9160}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:23 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9161..9180}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:22 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9181..9200}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:21 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9201..9220}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:20 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9221..9240}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:19 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9241..9260}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:18 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9261..9280}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:17 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9281..9300}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:16 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9301..9320}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:15 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9321..9340}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:14 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9341..9360}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:13 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9361..9380}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:12 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9381..9400}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:11 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9401..9420}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:10 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9421..9440}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:09 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9441..9460}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:08 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9461..9480}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:07 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9481..9500}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:06 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9501..9520}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:05 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9521..9540}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:04 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9541..9560}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:03 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9561..9580}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:02 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9581..9600}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:01 sidebar 12
execute as @a if entity @e[tag=timer,type=armor_stand,scores={event=9601..}] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §a00:00 sidebar 12

execute as @a if entity @e[tag=timer,scores={change=1..}] run scoreboard players set  sidebar 11

execute as @e[tag=redB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §c§lRed:§a§l✓ sidebar 10
execute as @e[tag=blueB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §1§lBlue:§a§l✓ sidebar 9
execute as @e[tag=greenB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2§lGreen:§a§l✓ sidebar 8
execute as @e[tag=yellowB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §e§lYellow:§a§l✓ sidebar 7
execute as @e[tag=whiteB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §f§lWhite:§a§l✓ sidebar 5
execute as @e[tag=grayB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7§lGray:§a§l✓ sidebar 3
execute as @e[tag=aquaB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §b§lAqua:§a§l✓ sidebar 6
execute as @e[tag=pinkB] at @s if block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §d§lPink:§a§l✓ sidebar 4

execute as @e[tag=redB] at @s unless block ~ ~ ~ cake unless entity @a[tag=red] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §c§lRed:§c§l✘ sidebar 10
execute as @e[tag=blueB] at @s unless block ~ ~ ~ cake unless entity @a[tag=blue] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §1§lBlue:§c§l✘ sidebar 9
execute as @e[tag=greenB] at @s unless block ~ ~ ~ cake unless entity @a[tag=green] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2§lGreen:§c§l✘ sidebar 8
execute as @e[tag=yellowB] at @s unless block ~ ~ ~ cake unless entity @a[tag=yellow] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §e§lYellow:§c§l✘ sidebar 7
execute as @e[tag=whiteB] at @s unless block ~ ~ ~ cake unless entity @a[tag=white] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §f§lWhite:§c§l✘ sidebar 5
execute as @e[tag=grayB] at @s unless block ~ ~ ~ cake unless entity @a[tag=gray] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7§lGray:§c§l✘ sidebar 3
execute as @e[tag=aquaB] at @s unless block ~ ~ ~ cake unless entity @a[tag=aqua] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §b§lAqua:§c§l✘ sidebar 6
execute as @e[tag=pinkB] at @s unless block ~ ~ ~ cake unless entity @a[tag=pink] if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §d§lPink:§c§l✘ sidebar 4

execute store result score #red forge if entity @a[team=red]
execute as @e[tag=redB] at @s if score #red forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §c§lRed:§a§l5+ sidebar 10
execute as @e[tag=redB] at @s if score #red forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §c§lRed:§a§l4 sidebar 10
execute as @e[tag=redB] at @s if score #red forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §c§lRed:§a§l3 sidebar 10
execute as @e[tag=redB] at @s if score #red forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §c§lRed:§a§l2 sidebar 10
execute as @e[tag=redB] at @s if score #red forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §c§lRed:§a§l1 sidebar 10

execute store result score #blue forge if entity @a[team=blue]
execute as @e[tag=blueB] at @s if score #blue forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §1§lBlue:§a§l5+ sidebar 9
execute as @e[tag=blueB] at @s if score #blue forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §1§lBlue:§a§l4 sidebar 9
execute as @e[tag=blueB] at @s if score #blue forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §1§lBlue:§a§l3 sidebar 9
execute as @e[tag=blueB] at @s if score #blue forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §1§lBlue:§a§l2 sidebar 9
execute as @e[tag=blueB] at @s if score #blue forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §1§lBlue:§a§l1 sidebar 9

execute store result score #green forge if entity @a[team=green]
execute as @e[tag=greenB] at @s if score #green forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2§lGreen:§a§l5+ sidebar 8
execute as @e[tag=greenB] at @s if score #green forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2§lGreen:§a§l4 sidebar 8
execute as @e[tag=greenB] at @s if score #green forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2§lGreen:§a§l3 sidebar 8
execute as @e[tag=greenB] at @s if score #green forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2§lGreen:§a§l2 sidebar 8
execute as @e[tag=greenB] at @s if score #green forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §2§lGreen:§a§l1 sidebar 8

execute store result score #yellow forge if entity @a[team=yellow]
execute as @e[tag=yellowB] at @s if score #yellow forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §e§lYellow:§a§l5+ sidebar 7
execute as @e[tag=yellowB] at @s if score #yellow forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §e§lYellow:§a§l4 sidebar 7
execute as @e[tag=yellowB] at @s if score #yellow forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §e§lYellow:§a§l3 sidebar 7
execute as @e[tag=yellowB] at @s if score #yellow forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §e§lYellow:§a§l2 sidebar 7
execute as @e[tag=yellowB] at @s if score #yellow forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §e§lYellow:§a§l1 sidebar 7

execute store result score #white forge if entity @a[team=white]
execute as @e[tag=whiteB] at @s if score #white forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §f§lWhite:§a§l5+ sidebar 5
execute as @e[tag=whiteB] at @s if score #white forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §f§lWhite:§a§l4 sidebar 5
execute as @e[tag=whiteB] at @s if score #white forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §f§lWhite:§a§l3 sidebar 5
execute as @e[tag=whiteB] at @s if score #white forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §f§lWhite:§a§l2 sidebar 5
execute as @e[tag=whiteB] at @s if score #white forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §f§lWhite:§a§l1 sidebar 5

execute store result score #gray forge if entity @a[team=gray]
execute as @e[tag=grayB] at @s if score #gray forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7§lGray:§a§l5+ sidebar 3
execute as @e[tag=grayB] at @s if score #gray forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7§lGray:§a§l4 sidebar 3
execute as @e[tag=grayB] at @s if score #gray forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7§lGray:§a§l3 sidebar 3
execute as @e[tag=grayB] at @s if score #gray forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7§lGray:§a§l2 sidebar 3
execute as @e[tag=grayB] at @s if score #gray forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §7§lGray:§a§l1 sidebar 3

execute store result score #aqua forge if entity @a[team=aqua]
execute as @e[tag=aquaB] at @s if score #aqua forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §b§lAqua:§a§l5+ sidebar 6
execute as @e[tag=aquaB] at @s if score #aqua forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §b§lAqua:§a§l4 sidebar 6
execute as @e[tag=aquaB] at @s if score #aqua forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §b§lAqua:§a§l3 sidebar 6
execute as @e[tag=aquaB] at @s if score #aqua forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §b§lAqua:§a§l2 sidebar 6
execute as @e[tag=aquaB] at @s if score #aqua forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §b§lAqua:§a§l1 sidebar 6

execute store result score #pink forge if entity @a[team=pink]
execute as @e[tag=pinkB] at @s if score #pink forge matches 5.. unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §d§lPink:§a§l5+ sidebar 4
execute as @e[tag=pinkB] at @s if score #pink forge matches 4 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §d§lPink:§a§l4 sidebar 4
execute as @e[tag=pinkB] at @s if score #pink forge matches 3 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §d§lPink:§a§l3 sidebar 4
execute as @e[tag=pinkB] at @s if score #pink forge matches 2 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §d§lPink:§a§l2 sidebar 4
execute as @e[tag=pinkB] at @s if score #pink forge matches 1 unless block ~ ~ ~ cake if entity @e[tag=timer,scores={change=1..}] run scoreboard players set §d§lPink:§a§l1 sidebar 4

execute store result score red playerCount if entity @a[team=red]
execute store result score blue playerCount if entity @a[team=blue]
execute store result score green playerCount if entity @a[team=green]
execute store result score yellow playerCount if entity @a[team=yellow]
execute store result score aqua playerCount if entity @a[team=aqua]
execute store result score white playerCount if entity @a[team=white]
execute store result score pink playerCount if entity @a[team=pink]
execute store result score gray playerCount if entity @a[team=gray]

scoreboard players reset @e[tag=timer] change

execute if entity @a[tag=give] run function bw:give
execute if entity @e[tag=redb,type=shulker] run function bw:give
execute if entity @e[tag=blueb,type=shulker] run function bw:give
execute if entity @e[tag=greenb,type=shulker] run function bw:give
execute if entity @e[tag=yellowb,type=shulker] run function bw:give
execute if entity @e[tag=grayb,type=shulker] run function bw:give
execute if entity @e[tag=whiteb,type=shulker] run function bw:give
execute if entity @e[tag=aquab,type=shulker] run function bw:give
execute if entity @e[tag=pinkb,type=shulker] run function bw:give
execute if entity @e[tag=diaf,type=shulker] run function bw:give
execute if entity @e[tag=emeraldf,type=shulker] run function bw:give
execute if entity @e[tag=Sspawn,type=shulker] run function bw:give
execute if entity @e[tag=Echestf,type=shulker] run function bw:give
execute if entity @e[tag=chestf,type=shulker] run function bw:give
execute if entity @e[tag=reds,type=shulker] run function bw:give
execute if entity @e[tag=blues,type=shulker] run function bw:give
execute if entity @e[tag=greens,type=shulker] run function bw:give
execute if entity @e[tag=yellows,type=shulker] run function bw:give
execute if entity @e[tag=grays,type=shulker] run function bw:give
execute if entity @e[tag=whites,type=shulker] run function bw:give
execute if entity @e[tag=aquas,type=shulker] run function bw:give
execute if entity @e[tag=pinks,type=shulker] run function bw:give
execute if entity @e[tag=redf,type=shulker] run function bw:give
execute if entity @e[tag=bluef,type=shulker] run function bw:give
execute if entity @e[tag=greenf,type=shulker] run function bw:give
execute if entity @e[tag=yellowf,type=shulker] run function bw:give
execute if entity @e[tag=grayf,type=shulker] run function bw:give
execute if entity @e[tag=whitef,type=shulker] run function bw:give
execute if entity @e[tag=aquaf,type=shulker] run function bw:give
execute if entity @e[tag=pinkf,type=shulker] run function bw:give

execute store result score #count forge if entity @e[tag=diaF,type=armor_stand]
execute if score #count forge matches 4.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:7}]}

execute store result score #count1 forge if entity @e[tag=emeraldF,type=armor_stand]
execute if score #count1 forge matches 4.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:6}]}

execute store result score #count2 forge if entity @e[tag=forge,type=armor_stand]
execute if score #count2 forge matches 8.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:5}]}

execute store result score #count3 forge if entity @e[tag=spawnC,type=armor_stand]
execute if score #count3 forge matches 8.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:4}]}

execute store result score #count4 forge if entity @e[tag=bed,type=armor_stand]
execute if score #count4 forge matches 8.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:3}]}

execute store result score #count5 forge if entity @e[tag=shop,type=armor_stand]
execute if score #count5 forge matches 8.. run clear @a minecraft:villager_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:2}]}
execute store result score #count6 forge if entity @e[tag=upgrade,type=armor_stand]
execute if score #count6 forge matches 8.. run clear @a minecraft:villager_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:1}]}

execute store result score #count7 forge if entity @e[tag=spawn,type=armor_stand]
execute if score #count7 forge matches 1.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:8}]}

execute store result score #count8 forge if entity @e[tag=chest,type=armor_stand]
execute if score #count8 forge matches 8.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:9}]}

execute store result score #count9 forge if entity @e[tag=echest,type=armor_stand]
execute if score #count9 forge matches 8.. run clear @a minecraft:shulker_spawn_egg{Enchantments:[{id:"minecraft:protection",lvl:10}]}

execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:chainmail_boots"}]}] at @s run tag @s add chainboots
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:chainmail_leggings"}]}] at @s run tag @s add chainlegs
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:iron_boots"}]}] at @s run tag @s add ironboots
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:iron_leggings"}]}] at @s run tag @s add ironlegs
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:diamond_boots"}]}] at @s run tag @s add diaboots
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:diamond_leggings"}]}] at @s run tag @s add dialegs

execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:chainmail_boots"}]}] at @s run tag @s remove diaboots
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:chainmail_boots"}]}] at @s run tag @s remove ironboots
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:leather_boots"}]}] at @s run tag @s remove chainboots
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:chainmail_leggings"}]}] at @s run tag @s remove dialegs
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:chainmail_leggings"}]}] at @s run tag @s remove ironlegs
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:leather_leggings"}]}] at @s run tag @s remove chainlegs

execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:iron_boots"}]}] at @s run tag @s remove diaboots
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:iron_boots"}]}] at @s run tag @s remove chainboots
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:leather_boots"}]}] at @s run tag @s remove ironboots
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:iron_leggings"}]}] at @s run tag @s remove dialegs
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:iron_leggings"}]}] at @s run tag @s remove chainlegs
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:leather_leggings"}]}] at @s run tag @s remove ironlegs

execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:diamond_boots"}]}] at @s run tag @s remove chainboots
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:diamond_boots"}]}] at @s run tag @s remove ironboots
execute as @a[nbt={Inventory:[{Slot:100b,id:"minecraft:leather_boots"}]}] at @s run tag @s remove diaboots
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:diamond_leggings"}]}] at @s run tag @s remove chainlegs
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:diamond_leggings"}]}] at @s run tag @s remove ironlegs
execute as @a[nbt={Inventory:[{Slot:101b,id:"minecraft:leather_leggings"}]}] at @s run tag @s remove dialegs

execute as @a[nbt={ActiveEffects:[{Id:14b}]}] at @s run replaceitem entity @s armor.head air
execute as @a[nbt={ActiveEffects:[{Id:14b}]}] at @s run replaceitem entity @s armor.chest air
execute as @a[nbt={ActiveEffects:[{Id:14b}]}] at @s run replaceitem entity @s armor.legs air
execute as @a[nbt={ActiveEffects:[{Id:14b}]}] at @s run replaceitem entity @s armor.feet air
execute as @a[nbt={ActiveEffects:[{Id:14b}]}] at @s run scoreboard players add @s invis 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=red] armor.head minecraft:leather_helmet{display:{color:16711680},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=red] armor.chest minecraft:leather_chestplate{display:{color:16711680},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=red] armor.legs minecraft:leather_leggings{display:{color:16711680},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=red] armor.feet minecraft:leather_boots{display:{color:16711680},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=blue] armor.head minecraft:leather_helmet{display:{color:6911},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=blue] armor.chest minecraft:leather_chestplate{display:{color:6911},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=blue] armor.legs minecraft:leather_leggings{display:{color:6911},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=blue] armor.feet minecraft:leather_boots{display:{color:6911},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=green] armor.head minecraft:leather_helmet{display:{color:65331},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=green] armor.chest minecraft:leather_chestplate{display:{color:65331},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=green] armor.legs minecraft:leather_leggings{display:{color:65331},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=green] armor.feet minecraft:leather_boots{display:{color:65331},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=gray] armor.head minecraft:leather_helmet{display:{color:8882055},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=gray] armor.chest minecraft:leather_chestplate{display:{color:8882055},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=gray] armor.legs minecraft:leather_leggings{display:{color:8882055},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=gray] armor.feet minecraft:leather_boots{display:{color:8882055},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=yellow] armor.head minecraft:leather_helmet{display:{color:16774920},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=yellow] armor.chest minecraft:leather_chestplate{display:{color:16774920},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=yellow] armor.legs minecraft:leather_leggings{display:{color:16774920},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=yellow] armor.feet minecraft:leather_boots{display:{color:16774920},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=white] armor.head minecraft:leather_helmet{display:{color:16777215},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=white] armor.chest minecraft:leather_chestplate{display:{color:16777215},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=white] armor.legs minecraft:leather_leggings{display:{color:16777215},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=white] armor.feet minecraft:leather_boots{display:{color:16777215},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=aqua] armor.head minecraft:leather_helmet{display:{color:5898239},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=aqua] armor.chest minecraft:leather_chestplate{display:{color:5898239},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=aqua] armor.legs minecraft:leather_leggings{display:{color:5898239},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=aqua] armor.feet minecraft:leather_boots{display:{color:5898239},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=pink] armor.head minecraft:leather_helmet{display:{color:16756218},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=pink] armor.chest minecraft:leather_chestplate{display:{color:16756218},HideFlags:3,Unbreakable:1b,Enchantments:[{id:"minecraft:blast_protection",lvl:5},{id:"minecraft:binding_curse",lvl:1}]} 1
execute as @a at @s if entity @s[scores={invis=600}] run replaceitem entity @s[team=pink] armor.legs minecraft:leather_leggings{display:{color:16756218},HideFlags:3,Unbreakable:1b} 1
execute as @a at @s if entity @s[scores={invis=600}] unless entity @s[tag=chainboots] unless entity @s[tag=ironboots] unless entity @s[tag=diaboots] run replaceitem entity @s[team=pink] armor.feet minecraft:leather_boots{display:{color:16756218},HideFlags:3,Unbreakable:1b} 1

execute as @a[scores={invis=1..}] at @s unless entity @s[nbt={ActiveEffects:[{Id:14b}]}] run scoreboard players set @s invis 600

execute as @a[scores={invis=600},tag=chainboots] at @s run replaceitem entity @s armor.feet minecraft:chainmail_boots{Unbreakable:1b} 1
execute as @a[scores={invis=600},tag=chainlegs] at @s run replaceitem entity @s armor.legs minecraft:chainmail_leggings{Unbreakable:1b} 1
execute as @a[scores={invis=600},tag=ironboots] at @s run replaceitem entity @s armor.feet minecraft:iron_boots{Unbreakable:1b} 1
execute as @a[scores={invis=600},tag=ironlegs] at @s run replaceitem entity @s armor.legs minecraft:iron_leggings{Unbreakable:1b} 1
execute as @a[scores={invis=600},tag=diaboots] at @s run replaceitem entity @s armor.feet minecraft:diamond_boots{Unbreakable:1b} 1
execute as @a[scores={invis=600},tag=dialegs] at @s run replaceitem entity @s armor.legs minecraft:diamond_leggings{Unbreakable:1b} 1
execute as @a[scores={invis=600}] at @s run scoreboard players reset @s invis


execute as @e[tag=shop,type=villager] at @s unless entity @e[tag=shop,type=armor_stand,distance=..1] run summon minecraft:armor_stand ~ ~ ~ {Marker:1b,NoGravity:1b,Tags:["guishop","shop"],ShowArms:1b,NoBasePlate:1b,ArmorItems:[{id:"minecraft:leather_boots",Count:1b},{id:"minecraft:leather_leggings",Count:1b},{id:"minecraft:leather_chestplate",Count:1b},{id:"minecraft:player_head",Count:1b,tag:{SkullOwner:"DrTestificate_MD"}}]}
execute as @e[tag=guishop] at @s run tp @s @e[tag=shop,type=villager,distance=..1,limit=1]
execute as @e[tag=shop,type=villager] at @s if entity @e[tag=guishop,distance=..1] run kill @s

execute as @e[tag=upgrade,type=villager] at @s unless entity @e[tag=shop,type=armor_stand,distance=..1] run summon minecraft:armor_stand ~ ~ ~ {Marker:1b,NoGravity:1b,Tags:["guiupgrade","upgrade"],ShowArms:1b,NoBasePlate:1b,ArmorItems:[{id:"minecraft:leather_boots",Count:1b},{id:"minecraft:leather_leggings",Count:1b},{id:"minecraft:leather_chestplate",Count:1b},{id:"minecraft:player_head",Count:1b,tag:{SkullOwner:"DrTestificate_MD"}}]}
execute as @e[tag=guiupgrade] at @s run tp @s @e[tag=upgrade,type=villager,distance=..1,limit=1]
execute as @e[tag=upgrade,type=villager] at @s if entity @e[tag=guiupgrade,distance=..1] run kill @s

execute as @e[tag=guishop] at @s unless entity @e[tag=shop,type=villager,distance=..2] unless entity @e[tag=itemgui,distance=..4] run summon chest_minecart ~ ~1 ~-.4 {NoGravity:1b,Tags:["itemgui"]}
execute as @e[tag=itemgui,type=minecraft:chest_minecart] at @s run data merge entity @s {NoGravity:1b,Invulnerable:1b,Tags:["itemgui"],CustomName:"[{\"text\":\"Item Shop\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" Shift Click Items\",\"color\":\"light_purple\"}]",DisplayState:{Name:"minecraft:air"},Items:[{Slot:0b,id:"minecraft:white_wool",Count:16b,tag:{display:{Name:"[{\"text\":\"Wool\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 4 Iron for 16 Wool\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:1b,id:"minecraft:oak_planks",Count:4b,tag:{display:{Name:"[{\"text\":\"Planks\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 3 Gold for 12\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:2b,id:"minecraft:sandstone",Count:16b,tag:{display:{Name:"[{\"text\":\"SandStone\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 8 Iron for 16\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:3b,id:"minecraft:end_stone",Count:16b,tag:{display:{Name:"[{\"text\":\"End Stone\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 24 Iron for 12\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:4b,id:"minecraft:white_stained_glass",Count:4b,tag:{display:{Name:"[{\"text\":\"Blast-Proof Glass\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 12 Iron for 3 Glass\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:5b,id:"minecraft:obsidian",Count:4b,tag:{display:{Name:"[{\"text\":\"Obsidian\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 4 Emerald for 4\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:6b,id:"minecraft:stone_sword",Count:1b,tag:{display:{Name:"[{\"text\":\"Stone Sword\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 10 Iron\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:7b,id:"minecraft:iron_sword",Count:1b,tag:{display:{Name:"[{\"text\":\"Iron Sword\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 7 Gold\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:8b,id:"minecraft:diamond_sword",Count:1b,tag:{display:{Name:"[{\"text\":\"Diamond Sword\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 4 Emeralds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:9b,id:"minecraft:chainmail_chestplate",Count:1b,tag:{display:{Name:"[{\"text\":\"Permanent Chain Armor\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 40 Iron\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:looting",lvl:1}]}},{Slot:10b,id:"minecraft:iron_chestplate",Count:1b,tag:{display:{Name:"[{\"text\":\"Permanent Iron Armor\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 12 Gold\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:looting",lvl:1}]}},{Slot:11b,id:"minecraft:diamond_chestplate",Count:1b,tag:{display:{Name:"[{\"text\":\"Permanent Dia Armor\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 6 Emeralds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:looting",lvl:1}]}},{Slot:12b,id:"minecraft:wooden_pickaxe",Count:1b,tag:{display:{Name:"[{\"text\":\"Upgrade Pickaxe\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 10 Iron\",\"color\":\"light_purple\"},{\"text\":\", 10 Iron\",\"color\":\"light_purple\"},{\"text\":\", 3 Gold\",\"color\":\"light_purple\"},{\"text\":\", 6 Gold\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:13b,id:"minecraft:wooden_axe",Count:1b,tag:{display:{Name:"[{\"text\":\"Upgrade Axe\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 10 Iron\",\"color\":\"light_purple\"},{\"text\":\", 10 Iron\",\"color\":\"light_purple\"},{\"text\":\", 3 Gold\",\"color\":\"light_purple\"},{\"text\":\", 6 Gold\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:14b,id:"minecraft:tnt",Count:1b,tag:{display:{Name:"[{\"text\":\"TNT\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 8 Gold\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:15b,id:"minecraft:golden_apple",Count:1b,tag:{display:{Name:"[{\"text\":\"Golden Apple\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 3 Gold\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:16b,id:"minecraft:ender_pearl",Count:1b,tag:{display:{Name:"[{\"text\":\"Ender Pearl\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 4 Emeralds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:17b,id:"minecraft:egg",Count:1b,tag:{display:{Name:"[{\"text\":\"Bridge Egg\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 2 Emeralds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:18b,id:"minecraft:potion",Count:1b,tag:{display:{Name:"[{\"text\":\"Potion of Jump\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 1 Emerald\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}],CustomPotionEffects:[{Id:8b,Amplifier:5b,Duration:800,ShowParticles:0b}],CustomPotionColor:1244954}},{Slot:19b,id:"minecraft:potion",Count:1b,tag:{display:{Name:"[{\"text\":\"Potion of Levitation\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 6 Emeralds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:2}],CustomPotionEffects:[{Id:25b,Amplifier:255b,Duration:400,ShowParticles:0b}],CustomPotionColor:16713207}},{Slot:20b,id:"minecraft:potion",Count:1b,tag:{display:{Name:"[{\"text\":\"Potion of Invisibility\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 2 Emerald\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:3}],CustomPotionEffects:[{Id:14b,Amplifier:1b,Duration:600,ShowParticles:0b}],CustomPotionColor:16777215}},{Slot:21b,id:"minecraft:ghast_spawn_egg",Count:1b,tag:{display:{Name:"[{\"text\":\"SilverFish\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 40 Iron\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:22b,id:"minecraft:snowball",Count:1b,tag:{display:{Name:"[{\"text\":\"FireBall\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 40 Iron\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:23b,id:"minecraft:bow",Count:1b,tag:{display:{Name:"[{\"text\":\"Bow Upgrade\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 12 Gold, 12 Gold, 4 Emerald\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:24b,id:"minecraft:arrow",Count:10b,tag:{display:{Name:"[{\"text\":\"Arrow\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 3 Gold for 10\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}
execute as @e[tag=shop,tag=guishop] at @s run tp @e[tag=itemgui,sort=nearest,distance=..4] ^ ^1 ^-.5

execute as @e[tag=guiupgrade] at @s unless entity @e[tag=shop,type=villager,distance=..2] unless entity @e[tag=upgradegui,distance=..4] run summon chest_minecart ~ ~1 ~-.4 {NoGravity:1b,Tags:["upgradegui"]}
execute as @e[tag=upgradegui,type=minecraft:chest_minecart] at @s run data merge entity @s {NoGravity:1b,Invulnerable:1b,Tags:["upgradegui"],CustomName:"[{\"text\":\"Team Upgrades\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" Shift Click\",\"color\":\"light_purple\"}]",DisplayState:{Name:"minecraft:air"},Items:[{Slot:0b,id:"minecraft:iron_nugget",Count:1b,tag:{display:{Name:"[{\"text\":\"Iron Forge\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 2 Diamonds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:1b,id:"minecraft:gold_nugget",Count:1b,tag:{display:{Name:"[{\"text\":\"Golden Forge\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 4 Diamonds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:2b,id:"minecraft:emerald_ore",Count:1b,tag:{display:{Name:"[{\"text\":\"Emerald Forge\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 8 Emeralds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:3b,id:"minecraft:golden_sword",Count:1b,tag:{display:{Name:"[{\"text\":\"Sharpness\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 4 Diamonds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:4b,id:"minecraft:chainmail_chestplate",Count:1b,tag:{display:{Name:"[{\"text\":\"Prot 1\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 2 Diamonds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:5b,id:"minecraft:iron_chestplate",Count:1b,tag:{display:{Name:"[{\"text\":\"Prot 2\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 4 Diamonds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:6b,id:"minecraft:golden_chestplate",Count:1b,tag:{display:{Name:"[{\"text\":\"Prot 3\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 8 Diamonds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:7b,id:"minecraft:diamond_chestplate",Count:1b,tag:{display:{Name:"[{\"text\":\"Prot 4\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 16 Diamonds\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}},{Slot:8b,id:"minecraft:tripwire_hook",Count:1b,tag:{display:{Name:"[{\"text\":\"Trap\",\"color\":\"white\",\"bold\":\"true\"},{\"text\":\" 1 Diamond\",\"color\":\"light_purple\"}]"},HideFlags:1,Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}
execute as @e[tag=upgrade,tag=guiupgrade] at @s run tp @e[tag=upgradegui,sort=nearest,distance=..4] ^ ^1 ^-.5

execute as @e[type=chest_minecart,tag=itemgui] at @s unless entity @e[tag=guishop,distance=..2] run kill @s
execute as @e[type=chest_minecart,tag=guiupgrade] at @s unless entity @e[tag=upgradegui,distance=..2] run kill @s

execute as @e[tag=guishop] at @s run tp @s ~ ~ ~ facing entity @e[tag=guiupgrade,limit=1,sort=nearest] eyes
execute as @e[tag=guiupgrade] at @s run tp @s ~ ~ ~ facing entity @e[tag=guishop,limit=1,sort=nearest] eyes

execute as @a store result score @s ironCount run clear @s minecraft:iron_ingot 0
execute as @a store result score @s goldCount run clear @s minecraft:gold_ingot 0
execute as @a store result score @s emeraldCount run clear @s minecraft:emerald 0
execute as @a store result score @s diaCount run clear @s minecraft:diamond 0

###Shop

execute if entity @a[nbt={Inventory:[{id:"minecraft:white_wool",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:oak_planks",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:sandstone",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:end_stone",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:white_stained_glass",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:obsidian",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:stone_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:iron_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:diamond_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:chainmail_chestplate",tag:{Enchantments:[{id:"minecraft:looting",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:iron_chestplate",tag:{Enchantments:[{id:"minecraft:looting",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:diamond_chestplate",tag:{Enchantments:[{id:"minecraft:looting",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:wooden_pickaxe",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:wooden_axe",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:tnt",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:golden_apple",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:potion",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:potion",tag:{Enchantments:[{id:"minecraft:protection",lvl:2}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:potion",tag:{Enchantments:[{id:"minecraft:protection",lvl:3}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:ghast_spawn_egg",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:snowball",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:bow",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop
execute if entity @a[nbt={Inventory:[{id:"minecraft:arrow",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:shop


###Prototype fireballs

scoreboard objectives add fire dummy
scoreboard players add @e[tag=fire] fire 1
scoreboard players add @e[type=snowball] fire 1
scoreboard players add @e[type=fireball] fire 1
kill @e[type=fireball,scores={fire=600..}]
kill @e[tag=fire,scores={fire=3..}]
execute as @e[type=snowball,scores={fire=1}] at @s run playsound minecraft:entity.ghast.shoot block @a[distance=..2]
execute as @e[tag=fire] at @s if entity @e[type=fireball,distance=..1] run kill @s
execute as @a at @s unless entity @s[x_rotation=70..90] if entity @e[type=snowball,distance=..3] unless entity @e[tag=fire,distance=..2] run summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,Marker:1b,NoGravity:1b,Tags:["fire"]}
execute as @a[x_rotation=70..90] at @s if entity @e[type=snowball,distance=..3] unless entity @e[type=fireball,distance=..2] run summon fireball ~ ~ ~ {ExplosionPower:3,direction:[0.0,-3.0,0.0]}
execute as @a[x_rotation=70..90] at @s if entity @e[type=snowball,distance=..3] run kill @e[type=snowball,distance=..2]
execute as @e[tag=fire,scores={fire=1}] at @s run tp @s @a[limit=1,distance=..1]
execute at @e[type=snowball] run tp @e[tag=fire,scores={fire=1..},limit=1,sort=nearest] ~ ~ ~
execute as @e[tag=fire,scores={fire=1}] at @s unless entity @e[type=minecraft:fireball,distance=..2] run summon fireball ^ ^ ^2 {ExplosionPower:3,direction:[0.0,0.0,0.0]}
execute as @e[type=fireball] at @s unless entity @e[tag=ball,distance=..2] run summon minecraft:armor_stand ~ ~ ~ {Invisible:1b,Marker:1b,NoGravity:1b,Tags:["ball"]}
execute as @e[tag=ball] at @s run tp @e[type=fireball,distance=..3,limit=1,sort=nearest]
execute as @e[tag=ball] at @s unless entity @e[type=fireball,distance=..4] run tag @s add impact
execute as @e[tag=impact] at @s run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 air replace #wool
execute as @e[tag=impact] at @s run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 air replace oak_planks
execute as @e[tag=impact] at @s run fill ~1 ~1 ~1 ~-1 ~-1 ~-1 air replace sandstone
kill @e[type=snowball,scores={fire=7..}]
kill @e[type=fireball,scores={fire=4..},nbt={direction:[0.0,0.0,0.0]}]
kill @e[tag=impact]

###Clear shop items if they blow up
kill @e[type=item,nbt={Item:{id:"minecraft:white_wool",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:white_stained_glass",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:oak_planks",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:stone_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:iron_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:diamond_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:diamond_chestplate",tag:{Enchantments:[{id:"minecraft:looting",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:chainmail_chestplate",tag:{Enchantments:[{id:"minecraft:looting",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:iron_chestplate",tag:{Enchantments:[{id:"minecraft:looting",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:obsidian",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:white_stained_glass",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:tnt",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:wooden_pickaxe",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:wooden_axe",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:ghast_spawn_egg",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:egg",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:golden_apple",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:ender_pearl",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:potion",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:potion",tag:{Enchantments:[{id:"minecraft:protection",lvl:2}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:potion",tag:{Enchantments:[{id:"minecraft:protection",lvl:3}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:chest"}}]
kill @e[type=item,nbt={Item:{id:"minecraft:minecart"}}]
kill @e[type=item,nbt={Item:{id:"minecraft:sandstone",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:end_stone",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:snowball",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:bow",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:arrow",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]

kill @e[type=item,nbt={Item:{id:"minecraft:iron_nugget",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:gold_nugget",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:emerald_ore",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:golden_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:chainmail_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:iron_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:golden_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:diamond_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]
kill @e[type=item,nbt={Item:{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}}]

####spinning block stuff

execute as @e[tag=emeraldF] at @s run data merge entity @s {ArmorItems:[{},{},{},{id:"minecraft:emerald_block",Count:1b}]}
execute as @e[tag=diaF] at @s run data merge entity @s {ArmorItems:[{},{},{},{id:"minecraft:diamond_block",Count:1b}]}
execute as @e[tag=diaF] at @s run tp @s ~ ~ ~ ~5 ~
execute as @e[tag=emeraldF] at @s run tp @s ~ ~ ~ ~5 ~

###Dia upgrades

execute if entity @a[nbt={Inventory:[{id:"minecraft:iron_nugget",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia
execute if entity @a[nbt={Inventory:[{id:"minecraft:gold_nugget",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia
execute if entity @a[nbt={Inventory:[{id:"minecraft:golden_sword",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia
execute if entity @a[nbt={Inventory:[{id:"minecraft:chainmail_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia
execute if entity @a[nbt={Inventory:[{id:"minecraft:iron_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia
execute if entity @a[nbt={Inventory:[{id:"minecraft:golden_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia
execute if entity @a[nbt={Inventory:[{id:"minecraft:diamond_chestplate",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia
execute if entity @a[nbt={Inventory:[{id:"minecraft:tripwire_hook",tag:{Enchantments:[{id:"minecraft:protection",lvl:1}]}}]}] run function bw:dia

### No Ender Pearl Damage

scoreboard objectives add pearl minecraft.used:minecraft.ender_pearl
scoreboard objectives add Ptime dummy
scoreboard players add @a[scores={pearl=1..}] Ptime 1
execute as @a[scores={pearl=1..,Ptime=..2}] at @s unless entity @e[tag=pearl,distance=..1.5] run summon armor_stand ~ ~ ~ {Marker:1b,NoGravity:1b,Invisible:0b,Tags:["pearl"]}
execute as @a[scores={pearl=1..}] at @s unless entity @e[tag=pearl,distance=..3] run effect give @s resistance 1 100 true
execute as @a[scores={pearl=1..}] at @s unless entity @e[tag=pearl,distance=..3] run effect give @s regeneration 1 30 true
execute as @a[scores={pearl=1..}] at @s unless entity @e[tag=pearl,distance=..3] run stopsound @s * entity.player.hurt
execute as @e[tag=pearl] at @s unless entity @a[scores={pearl=1..},distance=..3] run kill @s
execute as @e[tag=pearl] at @s run tp @a[sort=nearest,limit=1,distance=..3,scores={pearl=1..}]
execute as @a[scores={pearl=..1}] at @s unless entity @e[tag=pearl,distance=..3] run scoreboard players reset @s Ptime
execute as @a[scores={pearl=1..}] at @s unless entity @e[tag=pearl,distance=..3] run scoreboard players reset @s pearl

### Barrier kill
scoreboard players add @e[type=item,nbt={Item:{id:"minecraft:barrier",tag:{Enchantments:[{id:"minecraft:thorns",lvl:99}]}}}] forge 1
execute as @e[scores={forge=10..},type=item,nbt={Item:{id:"minecraft:barrier",tag:{Enchantments:[{id:"minecraft:thorns",lvl:99}]}}}] at @s run kill @e[type=!player,type=!item,distance=..2]
execute as @e[scores={forge=10..},type=item,nbt={Item:{id:"minecraft:barrier",tag:{Enchantments:[{id:"minecraft:thorns",lvl:99}]}}}] at @s run clear @a
execute as @e[scores={forge=10..},type=item,nbt={Item:{id:"minecraft:barrier",tag:{Enchantments:[{id:"minecraft:thorns",lvl:99}]}}}] at @s run tag @a[limit=1,sort=nearest] add give
kill @e[scores={forge=10..},type=item,nbt={Item:{id:"minecraft:barrier",Count:1b,tag:{Enchantments:[{id:"minecraft:thorns",lvl:99}]}}}]

###

execute as @e[tag=Dno] at @s unless entity @e[tag=diaF,distance=..4] run kill @s
execute as @e[tag=Eno] at @s unless entity @e[tag=emeraldF,distance=..4] run kill @s
execute as @e[tag=Sno] at @s unless entity @e[tag=spawnC,distance=..4] run kill @s