
# -> Set item
item replace entity 00000001-0000-002b-0000-00010000002b contents with chainmail_chestplate

# -> Set global item_edit modifier
item modify entity 00000001-0000-002b-0000-00010000002b contents overly_realistic:item_edit/special_item_edit/chainmail_chestplate

# -> Modify item with customized data
$item modify entity 00000001-0000-002b-0000-00010000002b contents \
    {\
        "function":"set_components",\
        "components": {\
                "minecraft:attribute_modifiers": [\
                {\
                  "type": "minecraft:armor",\
                  "amount": $(armor_final_armor),\
                  "id": "minecraft:armor.chestplate",\
                  "operation": "add_value",\
                  "slot": "chest"\
                },\
                {\
                  "type": "minecraft:armor_toughness",\
                  "amount": 0.0,\
                  "id": "minecraft:armor.chestplate",\
                  "operation": "add_value",\
                  "slot": "chest"\
                },\
                {\
                "type": "movement_speed",\
                "amount": -$(armor_final_speed_decrease_float),\
                "id": "overly_realistic:chainmail_armor_debuff_chestplate",\
                "operation": "add_multiplied_total",\
                "slot": "chest",\
                "display": {\
                  "type": "override",\
                  "value": [{"text":"-$(armor_final_speed_decrease)% Speed","color":"blue"}]\
                }\
              }\
            ],\
            "minecraft:equippable": {\
                "slot":"chest",\
                "asset_id":"overlyrealistic:chainmail_chestplate/armor_$(armor_item_build_bit_0)$(armor_item_build_bit_1)",\
                "equip_sound": "minecraft:item.armor.equip_chain"\
            }\
        }\
    }

# -> Set texture data
$item modify entity 00000001-0000-002b-0000-00010000002b contents \
    {\
        "function":"set_components",\
        "components": {\
            "minecraft:item_model": "overlyrealistic:items/armor/chainmail_chestplate",\
            "minecraft:custom_model_data": {\
                floats:[\
                    $(armor_item_build_bit_0), \
                    $(armor_item_build_bit_1) \
                ]\
            }\
        }\
    }

# -> Get player's blacksmithing skill
scoreboard players operation #or.lay_figure_user_blacksmithing_level OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.Player.WisdomStats.Blacksmithing

# -> Add skill-dependent modifiers
item modify entity 00000001-0000-002b-0000-00010000002b contents overly_realistic:armor_skill_modifiers/set_modifier

# -> Create item
execute as 00000001-0000-002b-0000-00010000002b run \
    loot spawn ~ ~ ~ loot overly_realistic:item_from_slot_sources/item_from_contents
