# Giving effects every tick is kind of laggy, so its better to just @s it too
effect give @s[tag=!playing,tag=!dev] minecraft:weakness 2 10 true
effect give @s[tag=!playing] minecraft:saturation 1 0 true
effect give @s[tag=!playing] minecraft:fire_resistance 1 0 true
execute unless entity @s[gamemode=spectator] run tag @s remove spectator
execute if entity @s[gamemode=spectator] run tag @s add spectator
# --

execute if entity @s[gamemode=adventure,tag=!dev] unless entity @e[type=marker,tag=railgun] run clear @s diamond_hoe[custom_data~{railgun:1b}]

execute if entity @s[tag=dev] if score @s maker_cooldown matches 1.. run scoreboard players remove @s maker_cooldown 1

execute if score @s item_cooldown matches 1 if items entity @s weapon.mainhand minecraft:diamond_hoe[custom_data={railgun:1b}] run function pctf:logic/items/railgun/reload
execute if score @s item_cooldown matches 1.. run scoreboard players remove @s item_cooldown 1
execute if score @s spell_cooldown1 matches 1.. run scoreboard players remove @s spell_cooldown1 1
execute if score @s spell_cooldown2 matches 1.. run scoreboard players remove @s spell_cooldown2 1
execute if score @s spell_cooldown3 matches 1.. run scoreboard players remove @s spell_cooldown3 1
execute if score @s leeway matches 1.. run scoreboard players remove @s leeway 1

execute if score @s drank matches 1.. at @s run function pctf:logic/player/potion/drank

execute if score @s thrown_snowball matches 1.. run function pctf:logic/items/check_snowball/start

tag @s add rabbit_check_temp
execute if entity @s[tag=jump_stolen] as @e[type=rabbit,tag=jump_rabbit] if score @s real_ID = @n[tag=rabbit_check_temp] real_ID run tag @s add confirmed
execute if entity @s[tag=jump_stolen] unless entity @e[type=rabbit,tag=confirmed] run function pctf:logic/items/lucky_block/outcomes/negative/solo/jump_rabbit/got_jump_back
tag @s remove rabbit_check_temp

execute if score @s cosmetics_ui matches 1.. run function pctf:cosmetics/check_score

function pctf:logic/player/check_credits

execute if score @s shot_bow matches 1.. run function pctf:logic/player/shot_bow

execute at @s run function pctf:logic/player/potion/main