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

# -> Add to break percentage
scoreboard players add @s OverlyRealistic.Player.UseItem_FlintFlake_BreakPercent 10

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

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

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

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