Skip to content

Client resources

Crystal Spider edited this page Jul 14, 2024 · 14 revisions

General info

Since by registering new leathered boots you are creating new items in the game, you need to create localization and texture related files for them.

Every time below you see the string custom_armor_material, it must be replaced with the value returned by your custom ArmorMaterial ArmorMaterial#getName() method.

Leathered Boots provides a dyeable texture overlay for items (boots in inventory), however it fits with Vanilla texture shape only.
If your custom boots have the same texture shape as Vanilla, you can freely use the provided overlay, otherwise everywhere below you see a reference to leathered_boots:item/leathered_boots_overlay you need to have your own dyeable overlay.

Leathered Boots can't provide dyeable texture overlay for armors (equipped boots), however if your custom boots have a texture that fits the Vanilla shape of equipped boots, you can download and reuse the same overlay used by Leathered Boots.
More about this in the Armor textures section below.

Localization

Under resources/assets/mod_id/lang/ add at least a en_us.json file with the following content:

{
  "item.mod_id.leathered_custom_armor_material_boots": "Custom Leathered Boots"
  // Do the above for all the leathered boots you add via the API
}

Item models

Since 1.20

For each of your leathered boots added via the API, you need to add several item models files under resources/assets/mod_id/models/item/.
There must be a file called leathered_custom_armor_material_boots.json with the following content:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "leathered_boots:item/leathered_boots_overlay",
    "layer1": "mod_id:item/leathered_custom_armor_material_boots"
  },
  "overrides": [
    {
      "model": "mod_id:item/trim/quartz/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.1
      }
    },
    {
      "model": "mod_id:item/trim/iron/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.2
      }
    },
    {
      "model": "mod_id:item/trim/netherite/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.3
      }
    },
    {
      "model": "mod_id:item/trim/redstone/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.4
      }
    },
    {
      "model": "mod_id:item/trim/copper/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.5
      }
    },
    {
      "model": "mod_id:item/trim/gold/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.6
      }
    },
    {
      "model": "mod_id:item/trim/emerald/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.7
      }
    },
    {
      "model": "mod_id:item/trim/diamond/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.8
      }
    },
    {
      "model": "mod_id:item/trim/lapis/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 0.9
      }
    },
    {
      "model": "mod_id:item/trim/amethyst/leathered_custom_armor_material_boots_trim",
      "predicate": {
        "trim_type": 1.0
      }
    }
  ]
}

As it might be obvious by now, the other needed files are the ones referenced in the JSON model above.
Those files are one for each trim material and should be placed in a subfolder called trim/trim_material/ with the name of the trim material.
Each of those files should be called leathered_custom_armor_material_boots_trim.json and have the following content:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "leathered_boots:item/leathered_boots_overlay",
    "layer1": "mod_id:item/leathered_custom_armor_material_boots",
    // Es. "minecraft:trims/items/boots_trim_amethyst" if the file is under the subfolder "amethyst"
    "layer2": "minecraft:trims/items/boots_trim_material" 
  }
}

All in all, the final item models structure should resemble the following:
image

Before 1.20

For each of your leathered boots added via the API, add a file called leathered_custom_armor_material_boots.json under resources/assets/mod_id/models/item/ with the following content:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "leathered_boots:item/leathered_boots_overlay",
    "layer1": "mod_id:item/leathered_custom_armor_material_boots"
  }
}

Item textures

This is very easy, as you can just duplicate your already existing custom boots texture and put it under resources/assets/mod_id/textures/item/ as leathered_custom_armor_material_boots.png, one file for each of your leathered boots added via the API.
The only catch is that you need to modify that texture to avoid covering the dyeable part of the texture, e.g. the leathered_boots:item/leathered_boots_overlay. You can download the leathered_boots:item/leathered_boots_overlay file from here and modify your texture accordingly.
If you are using your own custom dyeable part of the texture, you still need to change your base texture to not overlap with it.

Armor textures

Since 1.21

Everything below is still valid, however instead of placing your textures under resources/assets/minecraft/textures/models/armor/, you need to place them under resources/assets/mod_id/textures/models/armor/.

Before 1.21

When an armor piece is equipped, its texture always comes from resources/assets/minecraft/textures/models/armor/, regardless whether it's modded or not.
Of course, you need to add such kind of texture for each of your leathered boots added via the API.
Since your added leathered boots will be a dyeable armor piece, they each need 2 textures:

  • leathered_custom_armor_material_layer_1_overlay.png
    This file will contain the texture for the base armor, the part that's not dyeable.
    The format comes from Vanilla layer_1 armor PNGs that usually contains the texture for boots, helmet, and chestplate, but here we need it for boots only. The file also needs the extra _overlay suffix because that's required for the undyeable part of dyeable armors.
    Since you already have your armor set up, you can copy your layer_1 file and remove the square that is used for the bottom of the boots. Once copied, you need to rename it as stated above and place it under the specified folder.
    For example, below a comparison of the layer_1 texture of diamond armor and how it would need to be modified for diamond leathered boots:

    diamond_layer_1Separatordiamond_layer_1

    Note: you can right-click to download the PNGs files above and inspect them more closely.
  • leathered_custom_armor_material_layer_1.png
    This is the actual dyeable layer, for this reason it must be in gray scale.
    The format comes from Vanilla layer_1_overlay armor PNGs that usually contains the texture for boots, helmet, and chestplate, but here we need it for boots only. The file also needs the extra _overlay suffix removed because that's required for the dyeable part of dyeable armors.
    As for the other layer, the one used by Leathered Boots is nothing more than a modified version of the Vanilla one.
    If your custom armor boots texture, explained in the point before, has the same shape as the Vanilla one, then you can use one of the same file used by Leathered Boots. For example, you can download the leathered_diamond_layer_1.png and rename it as stated above and place it under the specified folder.
    If instead your custom armor boots texture does not fit with the Vanilla shape, you need to create your own dyeable texture in gray scale for your leathered boots.