
# -> Reset adv trigger
advancement revoke @s only overly_realistic:player/player_kill_entity

# -> Add to combat XP
function overly_realistic:players/wisdom/combat/add_to_skill_xp_c_kill_entity

# -> Do RNG
execute store result score #or.stamina_decrease_hurt_blocked OverlyRealistic.General.ArbitraryData run \
    random value -2..2

# -> If the RNG didn't pass then return
execute if score #or.stamina_decrease_hurt_blocked OverlyRealistic.General.ArbitraryData matches 1..2 run \
    return fail

# -> Altitude check
execute if entity @s[y=150,dy=9999] run \
    scoreboard players add #or.stamina_decrease_hurt_blocked OverlyRealistic.General.ArbitraryData 1

# -> Decrease stamina
scoreboard players operation @s OverlyRealistic.Player.Stats.Stamina -= #or.stamina_decrease_hurt_blocked OverlyRealistic.General.ArbitraryData
