
# -> Decrease stamina
scoreboard players remove @s OverlyRealistic.Animal.RidingStamina 3

# -> Clamp value
execute if score @s OverlyRealistic.Animal.RidingStamina matches ..-1 run \
    scoreboard players set @s OverlyRealistic.Animal.RidingStamina 0

# -> If current stamina <= 0 then return
execute if score @s OverlyRealistic.Animal.RidingStamina matches ..0 run \
    return run \
        effect give @s slowness 8 2 true

# -> Tag entity
tag @s add OverlyRealistic.Animal.RiddenAnimalIsSprinting

# -> Give speed
execute if block ~ ~-0.5 ~ #overly_realistic:is_road_block run \
    return run \
        function overly_realistic:players/riding_entity/animal_has_stamina/animal_sprint/speed_on_road
function overly_realistic:players/riding_entity/animal_has_stamina/animal_sprint/speed_on_ground
