
# -> Ghost operations
execute as @a[tag=OverlyRealistic.Player.IsGhost,gamemode=spectator] run \
    function overly_realistic:general/main_loops/main_loop_1t_operate

# -> Collapseable blocks
execute as @e[type=marker,tag=OverlyRealistic.CollapseableBlockPosition] at @s run \
    function overly_realistic:players/block_placement/block_collapse/marker_collapse_block

# -> Remove XP orbs
kill @e[type=experience_orb]

# -> Operate on items
execute as @e[type=item,tag=!OverlyRealistic.CheckedItemDrop] at @s run \
    function overly_realistic:general/block_physics/item_drop_operate

# -> Check if boats are falling/have fallen
execute as @e[type=#overly_realistic:boats] at @s run \
    function overly_realistic:general/boats/boats_get_fall

# -> Make animals panic if a player is nearby
execute as @e\
    [\
        type=#overly_realistic:all_specialized_animals,\
        tag=!OverlyRealistic.CommonAnimalAggressive,\
        type=!wolf,\
        tag=!OverlyRealistic.Animal.ShouldNotFlee,\
        x=0,\
        scores={OverlyRealistic.Animal.Stamina=1..}\
    ] \
    at @s \
    if entity @p[gamemode=!spectator,distance=..10] run \
        function overly_realistic:animals/operations/forward_velocity_animal_panic

# -> If player is near a fish, make it panic
execute as @e[type=#overly_realistic:fishes] \
    at @s \
    if entity @p[gamemode=!spectator,distance=..6] run \
        function overly_realistic:animals/operations/forward_velocity_fish_panic

# -> Operate on spears
execute as @e[type=item_display,tag=OverlyRealistic.Item.SpearDisplayEnt] at @s run \
    function overly_realistic:general/spears/spear_operate_1t

# -> Function tag
function #overly_realistic:general_loops/main_1t

# -> Loop
schedule function overly_realistic:general/main_loops/main_loop_1t 1t