enchant @s minecraft:protection 4
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:head_armor run data modify storage minecraft:reforge vanilla.type set value "Armor - Helmet"
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:head_armor run data modify storage minecraft:reforge vanilla.typeid set value 3
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:head_armor run execute store result storage minecraft:reforge vanilla.armor double 1 run random value 1..4
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:head_armor run execute store result storage minecraft:reforge vanilla.armor_toughness double 1 run random value 1..4
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:head_armor run function reforge:forging/item_data/mainhand/armor/attribute_head with storage minecraft:reforge vanilla
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:chest_armor run data modify storage minecraft:reforge vanilla.type set value "Armor - Chestplate"
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:chest_armor run data modify storage minecraft:reforge vanilla.typeid set value 4
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:chest_armor run execute store result storage minecraft:reforge vanilla.armor double 1 run random value 5..10
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:chest_armor run execute store result storage minecraft:reforge vanilla.armor_toughness double 1 run random value 1..4
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:chest_armor run function reforge:forging/item_data/mainhand/armor/attribute_chest with storage minecraft:reforge vanilla
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:leg_armor run data modify storage minecraft:reforge vanilla.type set value "Armor - Leggings"
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:leg_armor run data modify storage minecraft:reforge vanilla.typeid set value 5
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:leg_armor run execute store result storage minecraft:reforge vanilla.armor double 1 run random value 3..8
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:leg_armor run execute store result storage minecraft:reforge vanilla.armor_toughness double 1 run random value 1..4
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:leg_armor run function reforge:forging/item_data/mainhand/armor/attribute_legs with storage minecraft:reforge vanilla
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:foot_armor run data modify storage minecraft:reforge vanilla.type set value "Armor - Boots"
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:foot_armor run data modify storage minecraft:reforge vanilla.typeid set value 6
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:foot_armor run execute store result storage minecraft:reforge vanilla.armor double 1 run random value 1..3
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:foot_armor run execute store result storage minecraft:reforge vanilla.armor_toughness double 1 run random value 1..4
execute if data entity @s equipment.mainhand.components.minecraft:enchantments.minecraft:protection if items entity @s weapon.mainhand #minecraft:foot_armor run function reforge:forging/item_data/mainhand/armor/attribute_feet with storage minecraft:reforge vanilla