## slow
schedule function pctf:5s_tick 5s replace

execute as @e[type=interaction,tag=aqua_interaction] at @s at @n[type=block_display,tag=aqua_flag,distance=..250] run tp @s ~ ~-0.75 ~
execute as @e[type=interaction,tag=yellow_interaction] at @s at @n[type=block_display,tag=yellow_flag,distance=..250] run tp @s ~ ~-0.75 ~
execute as @e[type=interaction,tag=green_interaction] at @s at @n[type=block_display,tag=green_flag,distance=..250] run tp @s ~ ~-0.75 ~
execute as @e[type=interaction,tag=light_purple_interaction] at @s at @n[type=block_display,tag=light_purple_flag,distance=..250] run tp @s ~ ~-0.75 ~

execute as @e[type=block_display,tag=flag] at @s store result score @s temp if entity @e[type=block_display,tag=flag,distance=..2,tag=!dropped]
execute as @e[type=block_display,tag=flag] if score @s temp matches 2.. run kill @s

execute as @e[type=item,tag=!added,nbt={Item:{components:{"minecraft:custom_data":{coin:1b,one:1b}}}}] run data merge entity @s {Age:5700}
execute as @e[type=item,tag=!added,nbt={Item:{components:{"minecraft:custom_data":{coin:1b,one:1b}}}}] run tag @s add added

clear @a minecraft:elytra[damage=2]
clear @a minecraft:saddle

execute as @e[type=minecraft:fireball] at @s unless entity @p[distance=..128] run kill @s

execute as @a[tag=!admin,tag=dev,gamemode=creative] at @s unless entity @e[type=marker,distance=..300] run function pctf:mode/return_simple

recipe take @a *