
# -> Operate on explosions
execute as @e[type=marker,tag=OverlyRealistic.TntMarker,predicate=!overly_realistic:global/entity_is_on_vehicle] \
    at @s \
    positioned ~ ~-0.5 ~ run \
        function overly_realistic:general/explosions/tnt_marker_explosion_create

# -> Operate on baskets
execute as @e[type=interaction,tag=OverlyRealistic.Block.Basket,x=0] at @s run \
    function overly_realistic:general/custom_blocks/basket/looping_operations/main_operate_2t

# -> 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,x=0] \
    at @s \
    if entity @p[gamemode=!spectator,distance=..6] run \
        function overly_realistic:animals/operations/forward_velocity_fish_panic

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

# -> Loop
schedule function overly_realistic:general/main_loops/main_loop_2t 2t