
# --> Ore breaking checks for mining XP

# -> Diamond ore
execute if score @s OverlyRealistic.Player.WisdomSpecialized.Mine_DiamondOre matches 10.. run \
    function overly_realistic:players/wisdom/mining/add_to_skill_xp_c_mine_diamond_ore_10
execute if score @s OverlyRealistic.Player.WisdomSpecialized.Mine_DeepslateDiamondOre matches 10.. run \
    function overly_realistic:players/wisdom/mining/add_to_skill_xp_c_mine_diamond_ore_10

# -> Redstone ore
execute if score @s OverlyRealistic.Player.WisdomSpecialized.Mine_RedstoneOre matches 10.. run \
    function overly_realistic:players/wisdom/mining/add_to_skill_xp_c_mine_redstone_ore_10
execute if score @s OverlyRealistic.Player.WisdomSpecialized.Mine_DeepslateRedstoneOre matches 10.. run \
    function overly_realistic:players/wisdom/mining/add_to_skill_xp_c_mine_redstone_ore_10

# --> Stamina work

# -> If player has met the sprinting requirement then add to speed
execute if score @s OverlyRealistic.Player.SprintTime matches 100000.. run \
    function overly_realistic:players/stamina/improve_running/player_run_max_time

# --> Wisdom operations

# -> If player is near a map item frame then add scribing XP
execute if entity @s[tag=OverlyRealistic.Player.IsNearMapItemFrame] run \
    function overly_realistic:players/wisdom/scribing/add_to_skill_xp_c_be_near_bookshelves

# -> If player has level 5 scribing and is holding a scribe book then increase nearby players' stats
execute if score @s OverlyRealistic.Player.WisdomStats.Scribing matches 5.. \
    if items entity @s weapon.* *[custom_data~{IsScribeBook:1b}] \
    as @a[distance=..15] run \
        function overly_realistic:players/misc/scribe_book/scribe_book_buff_nearby
