# Cancel if the game is starting
execute unless score startTime gameInfoValues matches 0 run return fail

# If starts executes
    scoreboard players set startTime gameInfoValues -1
    scoreboard players set gameStatus gameInfoValues 2
    gamerule block_drops false
    execute at @e[type=marker,tag=cage,distance=0..200] run fill ~ ~-2 ~ ~ ~3 ~ air destroy
    execute at @e[type=marker,tag=cage,distance=0..200] run fill ~-1 ~-2 ~-1 ~1 ~3 ~1 air
    execute at @e[type=marker,tag=cage,distance=0..200] run particle block{block_state:"minecraft:glass"} ~ ~1 ~ 1 4 1 1 200
    execute at @e[type=marker,tag=cage,distance=0..200,scores={cage_type=7}] run fill ~-3 ~-1 ~-1 ~2 ~5 ~5 air
    kill @e[type=marker,tag=cage,distance=0..200]
    gamerule block_drops true

    effect give @a resistance 3 200 true
    effect give @a regeneration 3 200 true

    gamemode survival @a[tag=!spectating]

    title @a times 5 10 5
    title @a title ""
    title @a subtitle [{"translate":"subchronos.game.start","fallback":"Gᴏ!","color":"#8FFF2E"}]

    #sfx
        execute at @a run playsound minecraft:entity.breeze.jump ambient @p ~ ~ ~ 1 1
        execute at @a run playsound minecraft:entity.experience_orb.pickup ambient @p ~ ~ ~ 1 1


    #Start timers
        execute if score time_explosion option matches 1 run scoreboard players set timeExplosion gameInfoValues 180
        #+2m luego #+2m luego
        execute if score barrel_refill option matches 1 run scoreboard players set barrelRefill gameInfoValues 210
        function subchronos:game/scoreboard/tick1s

    #Stat
        scoreboard players add @a[tag=!spectating] statsGames 1

    #Starter Kit 
    execute if score initial_kit option matches 1 run give @a[tag=!spectating] stone_sword
    execute if score initial_kit option matches 1 run give @a[tag=!spectating] stone_pickaxe
    execute if score initial_kit option matches 1 run give @a[tag=!spectating] baked_potato 3

    #Supply Drop
        execute if score supply_drops option matches 1 run scoreboard players set timer supplyDropSpawningCooldown 1