Guide

Rename items to change their texture

In Minecraft you can rename any item in an anvil. A resource pack can give a renamed item a texture of its own: a diamond sword named “Excalibur” can shine gold while every other diamond sword stays the same. Java 1.21.5 and newer do this without mods; older versions need OptiFine or the CIT Resewn mod. The Texture Pack Maker writes the right files for your version.

Updated

Make one step by step

  1. Open the Texture Pack Maker and make a Java pack, or open one you have.
  2. Open an item’s texture, for example the diamond sword, and choose Name-based textures in its menu (⋮), or Names under the 3D preview.
  3. Type the name, for example Excalibur. Add more names if they should share the texture.
  4. Press Create and paint. The new texture starts as a copy of the item’s, so paint over it. 3D shape gives it a model of its own too.
  5. Press Export, install the pack, rename the item in an anvil to exactly that name, and hold it.

How names match

  • The name must be exactly the same, capital letters too: Excalibur and excalibur are different names. Add both if you want both to work.
  • Several names can share one texture, and one item can have many name-based textures.
  • An anvil takes names up to 50 characters long, without colour codes. A name given colours or bold with commands doesn’t match a plain name.
  • It changes the item in the hand, the inventory, on the ground and in item frames. A block placed from a renamed item looks as usual.

Java 1.21.5 and newer: no mods

Since 1.21.5 an item definition (assets/minecraft/items/<item>.json) can pick a model by the item’s name with a minecraft:select on the minecraft:component property and the minecraft:custom_name component. Anything else falls back to the item’s normal model:

{
  "model": {
    "type": "minecraft:select",
    "property": "minecraft:component",
    "component": "minecraft:custom_name",
    "cases": [
      {
        "when": ["Excalibur", "Sword of Light"],
        "model": {
          "type": "minecraft:model",
          "model": "minecraft:item/names/diamond_sword/excalibur"
        }
      }
    ],
    "fallback": {
      "type": "minecraft:model",
      "model": "minecraft:item/diamond_sword"
    }
  }
}

The named model is the item’s own model with the new picture, so the sword is still held like a sword:

{
  "parent": "minecraft:item/diamond_sword",
  "textures": {
    "layer0": "minecraft:item/names/diamond_sword/excalibur"
  }
}

If the pack already changes that item definition, for example with a 3D model made in the model editor, the names go in front of it. Java 1.21.4 has item definitions too, but can’t read an item’s name yet, so it gets the OptiFine files below. How item definitions and 3D items work.

Before 1.21.5: OptiFine or CIT Resewn

Older versions can’t pick a texture by name on their own. OptiFine’s Custom Item Textures (CIT) can, and so can the CIT Resewn mod for Fabric. The editor writes one .properties file per name-based texture in assets/minecraft/optifine/cit/:

# Excalibur, Sword of Light: needs OptiFine or the CIT Resewn mod
type=item
items=diamond_sword
texture=textures/item/names/diamond_sword/excalibur.png
nbt.display.Name=regex:(Excalibur|Sword of Light)

One name is written as it is; several become a regex: rule. From 1.20.5 the editor writes components.custom_name instead of nbt.display.Name; both mods read either. A texture with a 3D shape uses model= instead of texture=. A pack whose version range reaches from before 1.21.5 to after it gets both kinds of files.

Bedrock Edition

Bedrock resource packs can’t change how an item looks by its name. The game’s item names in Molang (such as query.is_item_name_any) are item ids like minecraft:diamond_sword, not the names players give them in an anvil, so the editor doesn’t offer name-based textures for Bedrock packs.

Open a pack that has them

Open a Java pack and its name-based textures show up under the item’s texture and in the window: OptiFine CIT rules for one item with a name and a texture or model, and 1.21.5+ item definitions that pick a model by name. Rules that check more than the name (damage, enchantments, several items) stay in the pack as they are. A rule with an OptiFine pattern such as ipattern:*sword* keeps it, and keeps working only with OptiFine and CIT Resewn.

Questions

My renamed item still looks normal. Why?

Check that the name is exactly the same, capital letters and spaces too, that the pack is turned on and above other packs, and that you play 1.21.5 or newer, or have OptiFine or CIT Resewn on an older version. An item renamed before you added the pack works too: the name is checked every time the item is drawn.

Can a name ignore capital letters?

Not in vanilla Minecraft: the name must match exactly. Add each spelling you want as its own name. OptiFine packs can use patterns that ignore capitals; opened packs keep theirs.

Can a renamed item be 3D?

Yes. Press 3D shape on a name-based texture to open the model editor for it, and start from a 3D item made from your new picture.

Do other players see it?

Players who use your pack see it, on servers too. The name itself is part of the item, so everyone sees the name; only the texture needs the pack.