

# -> Increase vitality
execute unless score @s OverlyRealistic.Player.Stats.Vitality matches 101.. \
    unless score @s OverlyRealistic.Player.BleedingTimer matches 1.. run \
        scoreboard players add @s OverlyRealistic.Player.Stats.Vitality 1

# -> Heal players if healthcare skill allows
execute if score @s OverlyRealistic.Player.WisdomStats.Healthcare matches 3.. run \
    scoreboard players add @a[tag=OverlyRealistic.Player.IsSick,distance=..20] OverlyRealistic.Player.IllnessTimer 100
execute if score @s OverlyRealistic.Player.WisdomStats.Healthcare matches 4.. run \
    effect give @a[tag=OverlyRealistic.Player.IsSick,distance=..10] regeneration 1 0 true

# -> Mining XP for breaking stone/deepslate
execute if score @s OverlyRealistic.Player.WisdomSpecialized.MineStone matches 32.. run \
    function overly_realistic:players/wisdom/mining/add_to_skill_xp_c_mine_32_stone
execute if score @s OverlyRealistic.Player.WisdomSpecialized.MineDeepslate matches 32.. run \
    function overly_realistic:players/wisdom/mining/add_to_skill_xp_c_mine_32_deepslate

# -> Mining XP for being in deep depths
execute if items entity @s weapon.* #overly_realistic:miner_items \
    if entity @s[y=30,dy=-9999] run \
        function overly_realistic:players/wisdom/mining/add_to_skill_xp_c_remain_underground