
# -> Tag player
tag @s add OverlyRealistic.Player.IsExhausted

# -> Apply attributes
attribute @s movement_speed modifier add overly_realistic:player_exhaustion_movement_speed -0.04 add_value
attribute @s jump_strength modifier add overly_realistic:player_exhaustion_jump_strength -1024 add_value
attribute @s attack_speed modifier add overly_realistic:player_exhaustion_attack_speed -0.38 add_value

# -> Add to exhaustion counter
scoreboard players add @s OverlyRealistic.Player.ExhaustionCounter 1

# -> If counter is not above 100 then return
execute unless score @s OverlyRealistic.Player.ExhaustionCounter matches 100.. run \
    return fail

# -> Reset counter
scoreboard players set @s OverlyRealistic.Player.ExhaustionCounter 0

# -> Add to max stamina
scoreboard players add @s OverlyRealistic.Player.Stats.MaxStamina 1