Custom Model Data Item Override Reference
Custom Model Data (CMD) in Minecraft is a powerful mechanism that unlocks an unprecedented level of item customization, allowing creators to introduce countless visual variations for existing items without ever touching the game’s core code. This system provides a sophisticated way to display different models or textures for a single item ID, transforming how resource pack creators and server owners can enrich the player experience.
![]()
The Core Mechanism: Item Overrides
At its heart, Custom Model Data functions as a numeric NBT (Named Binary Tag) tag attached to an item. When an item possesses this tag, a specially crafted resource pack interprets its value to display an alternative model or texture. This means that a single item, like a diamond sword, can have numerous visual variants – perhaps a rusty sword, an enchanted blade, or even a completely different weapon – all based on the numeric value stored in its CustomModelData tag.
The entire system is intrinsically tied to custom resource packs. Without a resource pack that defines these visual changes, the CustomModelData tag on an item will have no effect. The game uses a specific predicate, custom_model_data, within an item’s model JSON file to determine which custom model to load based on the item’s CMD value. This allows for a flexible and scalable approach to item appearance modification.
Crafting Your Resource Pack for CMD
Implementing Custom Model Data begins with setting up a proper resource pack. This pack will house all your custom models, textures, and the necessary JSON files to tell the game how to use them. Here’s the foundational structure you’ll need:
- Root Folder: This is your resource pack’s main directory (e.g.,
MyCustomPack). pack.mcmeta: A crucial file at the root that defines your pack’s format and description.Example
pack.mcmetacontent:{
"pack": {
"pack_format": 26, // Adjust for your Minecraft version
"description": "Custom Model Data Showcase"
}
}assetsFolder: Contains all the game assets you’re overriding or adding.assets/minecraftFolder: The default namespace for vanilla assets. You’ll typically place your overrides here.assets/minecraft/modelsFolder: Where item models reside.assets/minecraft/models/itemFolder: Specifically for item models.assets/minecraft/texturesFolder: Where your custom textures are stored.assets/minecraft/textures/itemFolder: Specifically for item textures.
Once this structure is in place, you’re ready to define your custom models and link them using the Custom Model Data system.
Implementing Overrides in Item Models
The core of CMD lies within the JSON model file of the base item you wish to modify. You’ll need to locate or create the model file for the vanilla item (e.g., diamond_sword.json if you’re overriding the diamond sword). This file is typically found in the vanilla resource pack at assets/minecraft/models/item/.
Within this base item’s JSON model, you’ll add an overrides array. Each entry in this array will contain a predicate that checks the custom_model_data value and a model path pointing to your custom model. The game processes these overrides in the order they appear; the first predicate that matches the item’s CMD value will determine the model displayed.
Here’s an example structure demonstrating how to add overrides:
{
"parent": "item/handheld",
"textures": {
"layer0": "item/diamond_sword"
},
"overrides": [
{ "predicate": { "custom_model_data": 1 }, "model": "item/custom_sword_1" },
{ "predicate": { "custom_model_data": 2 }, "model": "item/custom_sword_2" },
{ "predicate": { "custom_model_data": 100 }, "model": "item/special_sword" }
]}
In this example:
- The
"parent"and"textures"define the default appearance of the diamond sword. - The
"overrides"array contains multiple entries. - Each entry specifies a
"predicate". When an item hasCustomModelData:1, the game will use the model specified by"model": "item/custom_sword_1". - The model paths (e.g.,
"item/custom_sword_1") refer to JSON files located in your resource pack atassets/minecraft/models/item/custom_sword_1.json.
Creating Custom Models and Textures
For each entry in your overrides array, you’ll need a corresponding custom model JSON file and its associated texture. These custom model files are typically simple, referencing a parent model (like item/generated for 2D items or a block model for 3D items) and defining their textures.
For instance, if you have "model": "item/custom_sword_1", you would create a file at assets/minecraft/models/item/custom_sword_1.json. Its content might look like this:
{
"parent": "item/handheld",
"textures": {
"layer0": "item/custom_sword_texture_1"
}
}
And then, you would place the actual image file (e.g., custom_sword_texture_1.png) in assets/minecraft/textures/item/. This modular approach allows you to create complex visual libraries while keeping your files organized.
Integrating with Datapacks for Dynamic Changes
While resource packs handle the visual display, datapacks provide the dynamic control over an item’s CustomModelData. Datapacks can utilize commands to alter the CMD value of items in a player’s inventory, in containers, or even items dropped in the world. This is particularly powerful for:
- Progressive Upgrades: As a player completes quests or levels up, their sword could visually upgrade.
- Conditional Appearances: An item might look different when enchanted, or when held by a specific player.
- Custom Crafting Outcomes: Crafting a unique item could yield a standard item ID with a specific CMD value, giving it a unique appearance.
A common command used to change CMD is /item modify (Minecraft 1.17+) or older methods involving /data merge. For player-driven interaction, a /trigger command can be set up to allow players to set an item’s CustomModelData value, often used in conjunction with a custom command system:
/trigger CustomModelData set <model data #>
This command would typically be executed by a player, triggering a function in a datapack that then modifies the held item’s NBT, applying the desired CMD value.
Newer Developments: Minecraft 1.21.4+ and Item Components
In Minecraft 1.21.4 and later, the item customization landscape has evolved with the introduction of item components. While item models can now be set directly using these components, Custom Model Data retains its significant utility. CMD remains invaluable for context-based model changes, such as displaying different textures for enchanted items, or for situations where you want a single item ID to represent a wide array of visual styles without creating a separate item component for each.
A notable change in these newer versions is that numerical CMD formats now need to be explicitly defined as a float (e.g., "custom_model_data": 1.0 instead of "custom_model_data": 1). This seemingly minor adjustment is crucial for compatibility. Furthermore, the system introduces new capabilities like minecraft:select and cases within item definitions for more advanced conditional model loading, allowing for even more intricate logic in how models are chosen based on various item properties, including CMD.
These new component-based systems can work alongside or complement the traditional CMD approach, offering creators more tools to achieve their desired visual effects. For scenarios demanding many visual variants tied to a single NBT integer, CMD continues to be the most straightforward and efficient method.
Why Custom Model Data Remains Relevant
Despite the introduction of newer item component systems, Custom Model Data holds its ground as a vital tool for several reasons:
- Scalability: It allows for hundreds, if not thousands, of unique visual variations for a single item ID, reducing the need for countless distinct item IDs.
- Simplicity for Variants: For simple visual changes based purely on a numeric tag, CMD is often more direct than complex component definitions.
- Legacy Compatibility: Many existing resource packs and server setups rely heavily on CMD, ensuring its continued relevance.
- Contextual Overrides: It excels at providing different appearances based on an item’s state or a specific numeric flag, which is harder to achieve with other methods without significant overhead.
Mastering Custom Model Data opens up a world of creative possibilities, allowing you to transform mundane vanilla items into a rich tapestry of custom-designed assets, enhancing the visual depth and immersion of any Minecraft world.