
# -> Reset power
scoreboard players set @s OverlyRealistic.Player.UseItem_SharpenedFlint_KnapBreakPower 0

# -> Add to break percentage
scoreboard players add @s OverlyRealistic.Player.UseItem_SharpenedFlint_KnapBreakPercent 15

# -> Clamp
scoreboard players set @s[scores={OverlyRealistic.Player.UseItem_SharpenedFlint_KnapBreakPercent=101..}] OverlyRealistic.Player.UseItem_SharpenedFlint_KnapBreakPercent 100

# -> Show break percentage
title @s times 0 35 40
title @s title ""
title @s subtitle [{text:"      "},{text:"",extra:[{text:"\u0010",font:"overlyrealistic:icons"},{text:""}],color:"#ffffff",shadow_color:0},{score:{name:"@s",objective:"OverlyRealistic.Player.UseItem_SharpenedFlint_KnapBreakPercent"},color:"#40ca52",shadow_color:-15708648},{text:"%",color:"#40ca52",shadow_color:-15708648},{text:" [",color:"gray"},{score:{name:"@s",objective:"OverlyRealistic.Player.UseItem_SharpenedFlint_KnapUsage"},color:"gray"},{text:"/4]",color:"gray"}]

# -> Decrease stamina
scoreboard players remove @s OverlyRealistic.Player.Stats.Stamina 5

# -> If break percent >= 100 then sharpen flint
execute if score @s OverlyRealistic.Player.UseItem_SharpenedFlint_KnapBreakPercent matches 100.. run \
    function overly_realistic:players/items/sharpened_flint/knapping/item_sharpen_flint
