execute if score .shield_break shield matches ..0 as @s[scores={shield=..0}] at @s run function main:settings/shield_break

execute as @s[scores={first_person=1..}] run scoreboard players remove @s first_person 1
execute if entity @s[scores={impact_frames=1..}] run function main:mechanics/effects/impact_frames
execute if entity @s[scores={evade=1..}] run function main:mechanics/effects/evade

function main:settings/in_air
execute as @s[predicate=main:holding/book] run function main:settings/book/give

#particles and attack
function main:mechanics/interaction/weapon/attack/tick

function main:mechanics/damage/enemy/hitmarker

function main:mechanics/particles/tick

execute as @s[scores={recoil=1..}] run function main:mechanics/effects/recoil

execute if entity @s[scores={root=1..}] at @s run function main:mechanics/effects/root

#player stuff
effect give @s health_boost infinite 10 true
effect give @s instant_health infinite 10 true
effect give @s saturation infinite 1 true

execute as @s[scores={player_id=1}] run function main:settings/player_data/tick

execute as @s[tag=!coral_detection,scores={player_id=1}] as @s run function main:settings/holding/tick

execute as @s[scores={player_id=1}] run function main:settings/scoreboards/tick with storage player_data 1

#movement
function main:mechanics/movement/tick

#gold
function main:mechanics/damage/enemy/gold_collect

execute if score @s lc matches 1.. run function main:mechanics/interaction/weapon/1

execute if entity @a[tag=coral_detection] unless items entity @s[tag=!air] weapon.mainhand warped_fungus_on_a_stick run function main:mechanics/interaction/weapon/coral_clear_schedule
execute if entity @a[tag=coral_detection] if items entity @s[tag=!holding] weapon.mainhand warped_fungus_on_a_stick run function main:mechanics/interaction/weapon/coral_schedule
