
# -> Add to time
scoreboard players add @s OverlyRealistic.Player.UseItem_ForgingHammer_Time 1

# -> If time < max then return
execute unless score @s OverlyRealistic.Player.UseItem_ForgingHammer_Time matches 2.. run \
    return fail

# -> If max amount of time is reached then return
execute if score @s OverlyRealistic.Player.UseItem_ForgingHammer_HitPower matches 11.. run \
    return run \
        function overly_realistic:general/custom_blocks/forging_plate/interactions/shaping_tool_forge_process/player_not_using_hammer

# -> Add to hit power
scoreboard players add @s OverlyRealistic.Player.UseItem_ForgingHammer_HitPower 1

# -> Show hit percentage
title @s times 0 35 40
title @s title ""

title @s[scores={OverlyRealistic.Player.UseItem_ForgingHammer_HitPower=..3}] subtitle [{text:"",extra:[{text:"\u0016",font:"overlyrealistic:icons"}],color:"#ffffff",shadow_color:0},{text:" "},{score:{name:"#or.forging_plate_hit_percentage",objective:"OverlyRealistic.General.ArbitraryData"},color:"#40ca52",shadow_color:-15708648},{text:"%",color:"#40ca52",shadow_color:-15708648}]
title @s[scores={OverlyRealistic.Player.UseItem_ForgingHammer_HitPower=4..5}] subtitle [{text:"",extra:[{text:"\u0016",font:"overlyrealistic:icons"}],color:"#ffffff",shadow_color:0},{text:" "},{score:{name:"#or.forging_plate_hit_percentage",objective:"OverlyRealistic.General.ArbitraryData"},color:"#ebd82d",shadow_color:-11647728},{text:"%",color:"#ebd82d",shadow_color:-11647728}]
title @s[scores={OverlyRealistic.Player.UseItem_ForgingHammer_HitPower=6..7}] subtitle [{text:"",extra:[{text:"\u0016",font:"overlyrealistic:icons"}],color:"#ffffff",shadow_color:0},{text:" "},{score:{name:"#or.forging_plate_hit_percentage",objective:"OverlyRealistic.General.ArbitraryData"},color:"#fc7324",shadow_color:-11655408},{text:"%",color:"#fc7324",shadow_color:-11655408}]
title @s[scores={OverlyRealistic.Player.UseItem_ForgingHammer_HitPower=8..}] subtitle [{text:"",extra:[{text:"\u0016",font:"overlyrealistic:icons"}],color:"#ffffff",shadow_color:0},{text:" "},{score:{name:"#or.forging_plate_hit_percentage",objective:"OverlyRealistic.General.ArbitraryData"},color:"#d62424",shadow_color:-11660784},{text:"%",color:"#d62424",shadow_color:-11660784}]
