Project icon

Custom item models tutorial

Minecraft Version(s)
1.14-1.14.2
Disclaimer: this is not a modeling tutorial

Prerequisites:

  • basic resource pack knowledge
How custom models work
Every item in the game has its own corresponding .json file which contains information about the textures and models of the items and when it should use them. The .json files are stored inside the game itself but can be overridden by a resource pack (which we will be doing in this tutorial).

Types of models
There are 2D and 3D models. 2D models are basically just regular textures (.png files) which are used by the game by default (example: diamond_sword.png). 3D models are actual models made in 3D modeling software.

What software should I use to create 3D models?
There are plenty of modeling tools out there for Minecraft but I will point out some of my favorites.
once you install your modeling software, its time to create a model. If you're not familiar with how any of these tools work, I suggest you look it up online as it takes very little time and there are plenty of good tutorials on youtube.

Once you have created a model and exported it, you should have a .json file. This is your model which you will use in your resource pack.

The next step is to create a resource pack to put our model in. If you don't know how to create one, here's an empty template with all the things you will need for this tutorial (except the model) https://www.dropbox.com/sh/n63kbgd28zrtad0/AACmkCml5yyoUuB6fL-en3CMa?dl=0

navigate inside the resource pack and go into: assets > minecraft > models > item.
You should see a folder named "custom" and the "carrot_on_a_stick.json" file. Let me explain what each of these are for.

the "custom" folder is totally optional but it helps organize your models. Move your exported models in this folder.

The "carrot_on_a_stick.json" file is the base model file for the carrot on a stick item, what that means is: it contains information about what texture the item should use.

The file normally looks like this:
JSON:
{
    "parent": "item/handheld_rod",
    "textures": {
        "layer0": "items/carrot_on_a_stick"
    }

}
as you can see, there is a tag called "textures" and it's pointing towards the texture the carrot on a stick is using in the game (assets > minecraft > textures > items > carrot_on_a_stick.png). This texture is used by default unless you override it.

How do we override the texture and replace it with a 3D model? by using something called "predicates".
A predicate is something used to detecting different states of the item, or in other words, its a condition.

Let's add a predicate to the code and point the file to our custom model.
JSON:
{
    "parent": "item/handheld_rod",
    "textures": {
        "layer0": "items/carrot_on_a_stick"
    },

    "overrides":[

     {"predicate": {"custom_model_data":1}, "model":"item/custom/my_model"}
     ]

}
The "overrides" tag is pretty self-explanatory, it specifies some things we can override. The "predicate" tag is basically a condition which we can test for and change the model if the criteria is met. So in this example, I'm testing to see if the carrot_on_a_stick item has a value of 1 on the "CustomModelData" tag. If the tag has a value of 1, the item should use the custom model.

What is the CustomModelData tag? that is a new NBT tag that allows us to switch between more custom models. Before it was added, we had to use predicates to change the model based on item damage.

now that you have the template, you can add another predicate and link it to a different model like this:
JSON:
{
    "parent": "item/handheld_rod",
    "textures": {
        "layer0": "items/carrot_on_a_stick"
    },

    "overrides":[

     {"predicate": {"custom_model_data":1}, "model":"item/custom/my_model"},
     {"predicate": {"custom_model_data":2}, "model":"item/custom/my_second_model"}

     ]

}
If you go into your game now and apply the resource pack, you can run this command to get the carrot on a stick:
Code:
/give @s carrot_on_a_stick
and you will notice that nothing happens, it looks the same as it looked before. That's because the condition in our file requires the "CustomModelData" tag to be 1 or 2 to apply a model to it.
Code:
/give @s carrot_on_a_stick{CustomModelData:1}
now that the item has the required criteria, the custom model should be applied to the item.

to add custom models to other items, paste the items base file in the same folder where carrot_on_a_stick.json is and add the predicates.

All .json base files can be found in .minecraft > versions > your_version > assets > minecraft > models > item
(you will need a archive program like winRAR to open the .jar file)
Author
MegaCrafter10
Views
16,828
First release
Last update
Rating
5.00 star(s) 1 ratings

More projects from MegaCrafter10

Latest updates

  1. Syntax correction

    Sorry for not noticing this earlier but the name of your custom model can't have uppercase...

Latest reviews

Thanks! I finaly got it!
The only thing is that in 1.15 it have to be: "layer0": "item/carrot_on_a_stick" and not "layer0": "item*s*/carrot_on_a_stick". But at the top it says for version 1.14 so its nevertheless a good Tutorial!
Top