
# -> Reset adv
advancement revoke @s only overly_realistic:player/wisdom_specific/player_place_deco_block

# -> Add to counter
scoreboard players add @s OverlyRealistic.Player.WisdomSpecialized.CraftDecoItems 1

# -> If non passable then return
execute unless score @s OverlyRealistic.Player.WisdomSpecialized.CraftDecoItems matches 32.. run \
    return fail

# -> Add to skill XP
scoreboard players add @s OverlyRealistic.Player.WisdomStats.Building_XP 20

# -> Reset counter
scoreboard players reset @s OverlyRealistic.Player.WisdomSpecialized.CraftDecoItems

# -> Intelligence buff
scoreboard players operation #or.intelligence_level OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.Player.Stats.Intelligence
scoreboard players operation #or.intelligence_level OverlyRealistic.General.ArbitraryData /= #or.static_num_2 OverlyRealistic.General.ArbitraryData
scoreboard players operation @s OverlyRealistic.Player.WisdomStats.Building_XP += #or.intelligence_level OverlyRealistic.General.ArbitraryData

# -> Remove other skills' xp
function overly_realistic:players/wisdom/building/remove_from_others_xp

# -> If current XP is greater than the cap then increase level
execute if score @s OverlyRealistic.Player.WisdomStats.Building_XP >= @s OverlyRealistic.Player.WisdomStats.Building_XP_Max run \
    function overly_realistic:players/wisdom/building/increase_level
