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 overwritten 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 which are used by the game by default (example: diamond sword). 3D models are actual models made in 3D modeling software and contain textures.

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 (not to be confused with the previous .json file I talked about for the items). 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/6y71jso9y52s0ss/AABYYOY5gPebk0gLD76IiLyQa?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 (.json file) 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. Now I say "base file" because this file can be used to point towards different model files so think of it more as instruction/information file.

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). You might remember me talking about 2D models? well, this is one of them. This texture is used by the item by default unless you overwrite it with a model.

Now how do we overwrite 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/myModel"}
     ]
   
}
I've added a predicate/condition to the code so let me explain what this does. The "overrides" tag is pretty self-explanatory, it specifies some things we can override. Now 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.

What is the CustomModelData tag? that is a new NBT tag added to all items which allow us to switch between more custom models. Before it was added, we had to detect item damages with the predicates and that how we changed our models until now.

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/myModel"},
     {"predicate": {"custom_model_data":2}, "model":"item/custom/mySecondModel"}

     ]
   
}
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 item will be applied instead of the normal 2d texture.

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 just like before.

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)
  • Like
Reactions: MinecraftDoodler
Author
MegaCrafter10
Views
2,678
First release
Last update
Rating
0.00 star(s) 0 ratings

More projects from MegaCrafter10

Top