
# -> Advancement
advancement grant @s only overly_realistic:advancements/iron_age/forging/hammer_time

# -> If player is on 0 power then return
execute unless score @s OverlyRealistic.Player.UseItem_ForgingHammer_HitPower matches 3.. run \
    return fail

# -> Iron forging hammer extra
execute if items entity @s weapon.mainhand *[custom_data~{forging_hammer_type: "iron"}] run \
    scoreboard players add #or.forging_plate_hit_percentage OverlyRealistic.General.ArbitraryData 2

# -> Power 1
execute if score @s OverlyRealistic.Player.UseItem_ForgingHammer_HitPower matches 1..3 run \
    return run \
        scoreboard players add #or.forging_plate_hit_percentage OverlyRealistic.General.ArbitraryData 1

# -> Power 2
execute if score @s OverlyRealistic.Player.UseItem_ForgingHammer_HitPower matches 4..5 run \
    return run \
        scoreboard players add #or.forging_plate_hit_percentage OverlyRealistic.General.ArbitraryData 2

# -> Power 3
execute if score @s OverlyRealistic.Player.UseItem_ForgingHammer_HitPower matches 6..7 run \
    return run \
        scoreboard players add #or.forging_plate_hit_percentage OverlyRealistic.General.ArbitraryData 4

# -> Power 4
execute if score @s OverlyRealistic.Player.UseItem_ForgingHammer_HitPower matches 8.. run \
    return run \
        scoreboard players add #or.forging_plate_hit_percentage OverlyRealistic.General.ArbitraryData 5
