#Starting tick
    execute if score gameStatus gameInfoValues matches 1 run function subchronos:game/starting/tick

#Die system
    execute as @a[scores={die=1..}] at @s run function subchronos:game/death

#Spect
    execute as @a[tag=spectating,distance=100..] at @s run function subchronos:game/dont_leave

#Disable portals
    execute as @e[type=#subchronos:portal_passable,tag=!spectating] at @s if block ~ ~ ~ nether_portal run setblock ~ ~ ~ air destroy
    execute as @e[type=#subchronos:all_rideables] at @s run fill ~2 ~2 ~2 ~-2 ~-2 ~-2 air replace nether_portal

#Trident void
    execute as @e[type=trident] store result score @s y run data get entity @s Pos[1]
    execute as @e[type=trident,scores={y=..-60}] at @s run function subchronos:game/trident_void

#Custom items
    function subchronos:game/items/tick

#Supply drop
    execute as @e[type=block_display,tag=supply_drop.core] at @s run function subchronos:game/items/supply_drop/tick

#Cosmetics
    # Arrow trail
        execute as @e[scores={arrow_type=2..},type=arrow] run function subchronos:game/cosmetics/apply_arrow_trail
        # Detect what trail haves the person shooting
            execute as @a[scores={arrow_type=2..}] at @s if entity @e[type=minecraft:arrow,distance=0..2] as @e[type=minecraft:arrow,distance=0..2] run scoreboard players operation @s arrow_type = @p arrow_type

    # Apply shield type
        execute as @a[scores={shield_type=2..},predicate=subchronos:shield_oh] run function subchronos:game/cosmetics/apply_shield_offhand
        execute as @a[scores={shield_type=2..},predicate=subchronos:shield_mh] run function subchronos:game/cosmetics/apply_shield_normal

#Natural SupplyDrops Spawn
    execute if score supply_drops option matches 1 if score timer supplyDropSpawningCooldown matches 1.. run scoreboard players add timer supplyDropSpawningCooldown 1
    execute if score supply_drops option matches 1 if score timer supplyDropSpawningCooldown matches 800.. if predicate {condition:"minecraft:random_chance",chance:0.4} run function subchronos:game/generate_supply
    execute if score supply_drops option matches 1 if score timer supplyDropSpawningCooldown matches 800.. run scoreboard players set timer supplyDropSpawningCooldown 1

#tope de bloques
    fill 950 40 1094 1088 40 958 air

#Check if end
    execute if score gameStatus gameInfoValues matches 2 run function subchronos:game/end/check