## half second tick
schedule function pctf:half_second_tick 10t replace
execute as @e[tag=flag_dropoff] at @s if entity @p[distance=..8] run fill ~-1 ~ ~-1 ~1 ~2 ~1 minecraft:air replace #pctf:can_break
execute as @e[tag=flag] at @s run fill ~-1 ~-2 ~-1 ~1 ~ ~1 minecraft:air replace #pctf:can_break
execute as @e[tag=shop] at @s run fill ~-1 ~-2 ~-1 ~1 ~ ~1 minecraft:air replace #pctf:can_break

execute as @a[tag=playing] store result score @s temp run clear @s minecraft:sunflower[minecraft:custom_data~{coin:1b}] 0
execute as @a[tag=playing] if score @s temp matches 1.. run function pctf:logic/game/coin_rain/collect

execute as @a[tag=playing] store result score @s temp run clear @s minecraft:emerald[minecraft:custom_data={gem:1b}] 0
execute as @a[tag=playing] if score @s temp matches 1.. run function pctf:logic/game/coin_rain/collect

execute if score .apocalypse settings matches 1 as @e[type=item,nbt={Item:{id:"minecraft:sunflower",components:{"minecraft:custom_data":{coin:1b}}}},tag=!team] run function pctf:logic/game/apocalypse/check_coin

#execute unless entity @a[tag=end_game] run kill @e[type=minecraft:firework_rocket]