
# -> Add time
scoreboard players add @s OverlyRealistic.World.HeatedWroughtIron_Player_UsageTime 1

# -> If time < min operation time then return
execute unless score @s OverlyRealistic.World.HeatedWroughtIron_Player_UsageTime matches 5.. run \
    return fail

# -> If player is not holding a hammer then return
execute unless items entity @s weapon.mainhand *[custom_data~{IsForgingHammer:1b}] run \
    return run \
        function overly_realistic:general/custom_blocks/heated_wrought_iron/loop_operations/player_specific/player_stop_interaction

# -> If player is not looking at wrought iron then return
#execute unless predicate overly_realistic:player/wrought_iron/looking_at_heated_wrought_iron run \
    return run \
        function overly_realistic:general/custom_blocks/heated_wrought_iron/loop_operations/player_specific/player_stop_interaction
execute unless entity @n[type=interaction,team=overly_realistic.heated_wrought_iron,distance=..5,sort=arbitrary] run \
    return run \
        function overly_realistic:general/custom_blocks/heated_wrought_iron/loop_operations/player_specific/player_stop_interaction

# -> Reset time
scoreboard players reset @s OverlyRealistic.World.HeatedWroughtIron_Player_UsageTime

# -> Add to method value
#scoreboard players add @s OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod 1

# -> If player has surpassed max method then circle back
#scoreboard players set @s[scores={OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod=6..}] OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod 1

# -> Display methods
title @s times 0 40 40
title @s title ""

title @s[scores={OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod=1}] subtitle [{text:"",extra:[{text:"\u0011",font:"overlyrealistic:hud/hud_wrought_iron_forging",shadow_color:0},{text:"\u0111",font:"overlyrealistic:hud/hud_wrought_iron_forging"},{score:{name:"@s",objective:"OverlyRealistic.World.HeatedWroughtIron_Player_ForgePercent"},font:"overlyrealistic:hud/hud_wrought_iron_forging"},{text:"%",font:"overlyrealistic:hud/hud_wrought_iron_forging"}]}]
title @s[scores={OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod=2}] subtitle [{text:"",extra:[{text:"\u0012",font:"overlyrealistic:hud/hud_wrought_iron_forging",shadow_color:0},{text:"\u0111",font:"overlyrealistic:hud/hud_wrought_iron_forging"},{score:{name:"@s",objective:"OverlyRealistic.World.HeatedWroughtIron_Player_ForgePercent"},font:"overlyrealistic:hud/hud_wrought_iron_forging"},{text:"%",font:"overlyrealistic:hud/hud_wrought_iron_forging"}]}]
title @s[scores={OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod=3}] subtitle [{text:"",extra:[{text:"\u0013",font:"overlyrealistic:hud/hud_wrought_iron_forging",shadow_color:0},{text:"\u0111",font:"overlyrealistic:hud/hud_wrought_iron_forging"},{score:{name:"@s",objective:"OverlyRealistic.World.HeatedWroughtIron_Player_ForgePercent"},font:"overlyrealistic:hud/hud_wrought_iron_forging"},{text:"%",font:"overlyrealistic:hud/hud_wrought_iron_forging"}]}]
title @s[scores={OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod=4}] subtitle [{text:"",extra:[{text:"\u0014",font:"overlyrealistic:hud/hud_wrought_iron_forging",shadow_color:0},{text:"\u0111",font:"overlyrealistic:hud/hud_wrought_iron_forging"},{score:{name:"@s",objective:"OverlyRealistic.World.HeatedWroughtIron_Player_ForgePercent"},font:"overlyrealistic:hud/hud_wrought_iron_forging"},{text:"%",font:"overlyrealistic:hud/hud_wrought_iron_forging"}]}]
title @s[scores={OverlyRealistic.World.HeatedWroughtIron_Player_SelectedMethod=5}] subtitle [{text:"",extra:[{text:"\u0015",font:"overlyrealistic:hud/hud_wrought_iron_forging",shadow_color:0},{text:"\u0111",font:"overlyrealistic:hud/hud_wrought_iron_forging"},{score:{name:"@s",objective:"OverlyRealistic.World.HeatedWroughtIron_Player_ForgePercent"},font:"overlyrealistic:hud/hud_wrought_iron_forging"},{text:"%",font:"overlyrealistic:hud/hud_wrought_iron_forging"}]}]
