
# -> If current skill level >= 5 then return
execute if score @s OverlyRealistic.Player.WisdomStats.Blacksmithing matches 5.. run \
    return run \
        scoreboard players operation @s OverlyRealistic.Player.WisdomStats.Blacksmithing_XP = @s OverlyRealistic.Player.WisdomStats.Blacksmithing_XP_Max

# -> Reset XP level
scoreboard players set @s OverlyRealistic.Player.WisdomStats.Blacksmithing_XP 150

# -> Increase level
scoreboard players add @s OverlyRealistic.Player.WisdomStats.Blacksmithing 1

# -> Increase XP cap
scoreboard players add @s OverlyRealistic.Player.WisdomStats.Blacksmithing_XP_Max 1200

# -> Scribe check
tag @s add OverlyRealistic.Player.CurrentPlayer
execute if entity @p[tag=!OverlyRealistic.Player.CurrentPlayer,scores={OverlyRealistic.Player.WisdomStats.Scribing=4..},distance=..32,sort=arbitrary] run \
    scoreboard players set @s OverlyRealistic.Player.WisdomStats.Scribing_XP 1000
tag @s remove OverlyRealistic.Player.CurrentPlayer

# -> Set advancements
function overly_realistic:players/wisdom/blacksmithing/set_advancements
