home Forumsplay_arrow Communities play_arrow Texturing

27

New 1.14 custom item models tutorial + example pack

27 emeralds32 replies13,593 views
created 10/27/2018 8:12 am by Geegaz history
last reply 07/16/2019 3:07 am
Hello, I'm Geegaz !

As you may know, the first snapshots of the 1.14 introduced a new format for the JSON item models : "custom_model_data". It's also a new NBT tag you can use on an item with the format {CustomModelData:<data here>}.
Here's a guide/tutorial on how to use it.


This tutorial is not meant for basic ressource pack creation as it touches JSON format.


NBT tag :

The Custom Model Data is a NBT tag that can be added to an item. We will use the iron_ingot as an example.
It's very simple to use as it is not different from any other NBT tag.

Note :
- The data doesn't take commas, if you add them the command won't give an error but will not work.

/give @s minecraft:iron_ingot{CustomModelData:1234567}

JSON format :

To the command above to work, the item needs its JSON format to be defined.
The code below shows how it works.
We use "overrides":{"predicate":{}} to define in which case we'll override the item's model with our custom model or, in this case, the gold_ingot's model.
Here, we wil override it if the item has a CustomModelData of 1234567.

Notes :
- The data is composed of a number with up to 7 digits
*Edit: Since 1.14 the CustomModelData format changed, and using 8 digits doesn't work now*
- The data shouldn't start with 0, or it will give an "error" model
- Doing this only changes the item model. It won't work for blocks models but can change the block's item model (block in the inventory)

{
"parent": "item/generated",
"textures": {
"layer0": "item/iron_ingot"
},

"overrides": [
{"predicate": {"custom_model_data":1234567}, "model": "item/gold_ingot"}
]
}



General notes :
- Here I only changed the iron_ingot to a gold_ingot. But you can also use this format for custom models.
- A tool with durability can be changed, and the damage of the tool will not affect its custom model. It will allow adventure/rpg maps with weapon durability.
- Packs are not compatible ! A tool modified by multiple packs, even with different datas, will only use the first one in the order of the packs applied (the one on top of your active packs in the "ressourcepacks" window)

Hope this tutorial helped you, seeya !

Example pack download :
*Edit: reuploaded the pack to match changes made in 1.14*
- Mediafire -

This pack changes the iron ingot and the carved pumpkin
with the CustomModelData:1234567
Posted by avatar
Geegaz
Level 32 : Artisan Engineer
28

comment Login or register to post a reply.

32 replies

1
07/15/2019 5:29 pm
Level 5 : Apprentice Miner
thefrdeal
Hi Geegaz ,
I can't even get the example pack to work. I have the datapack installed and I'm on the right world, but typing in that command of giving a custom iron ingot just gives me a normal, not retextured iron ingot. Am I missing something else you have to do? Is it broken in 1.14.3 or something?
1
07/16/2019 3:07 am
Level 37 : Artisan Engineer
Geegaz
The example pack is a texturepack, you'll need to put it in the "resourcepacks" folder.

Then your items ingame should change texture.
1
07/14/2019 8:13 pm
Level 1 : New Miner
mnrock
Hello i am failing to understand the custom models for animated items. Even with danijel1023's response i don't understand how to do this with bows. If anyone could link me to a bow example i would be very grateful. Thanks.
1
07/15/2019 10:25 am
Level 37 : Artisan Engineer
Geegaz
Okay, to create an animated model you'll need to know first how to make an animated texture.

I won't start the subject here as it may need a whole post (more infos on the wiki), but just keep in mind that animating a model is just using an animated texture to show and hide parts of it.

If you just want to have different animated items, no need to worry on those details. You make an animated texture for the different states of the bow and use it for the corresponding models.
1
07/11/2019 1:50 pm
Level 1 : New Miner
Qualthorn
Does this work for armor when they're rendered on the player?
looking in the assets folder I can't figure it out
1
07/11/2019 2:04 pm
Level 37 : Artisan Engineer
Geegaz
Sadly no. Armor is a texture rendered on the entity, you cannot change its model vanilla. BUT ! Any item put on the head will render normally.
For example, you can use Cmd with pumpkin to create custom helmets (if you disable the pumpkin overlay of course).

ps: the armor texture is in the entity folder
Have a good day !
1
06/15/2019 6:33 pm
Level 1 : New Miner
danijel1023
Hi!
So, I'm new to this and I'm wondering how to make animated item models combined with this tag?
Thanks.
1
06/15/2019 9:39 pmhistory
Level 1 : New Miner
danijel1023
Nevermind. When you're done with modeling and texturing, just make <texture (picture) name>.png.mcmeta file next to your texture (picture) and extend your texture (picture) as you would normally do.

Create models (including free editor): https://www.youtube.com/watch?v=kQ3YftRMg5k
How to use custom item models tag: https://www.youtube.com/watch?v=iU8225raYuk&t
create textures (including free editor): https://www.youtube.com/watch?v=JEg09mNUlD0&
create textures: https://www.youtube.com/watch?v=DojdWVjGsTY
1
06/07/2019 3:40 pm
Level 1 : New Network
KateYatsumaru
I tried to add custom textures but it didn't work, seems whenever I try to do anything with the model folder it breaks.
1
06/08/2019 3:21 pm
Level 17 : Journeyman Dragon
dragonmaster
Can you paste what you have tried in here?
1
06/05/2019 6:42 pm
Level 1 : New Crafter
ada322
Is it possible to change the model of a chestplate or any other armor?
2
06/05/2019 11:29 pm
Level 1 : New Explorer
TheFalc
Just the item property, not the model of the armor. But you can change the texture of the armor, if that is the case.
1
06/05/2019 1:56 am
Level 1 : New Miner
Muttley
How would I go about changing the model of something like a Axe.

I tried using the example above but failed, would you be able to give me an example.



I am trying to give an axe a whole new texture, so for example I could give someone an emerald axe
1
06/05/2019 6:09 am
Level 37 : Artisan Engineer
Geegaz
Please read the answer I made to Aetheriox below. I explain here how to create a new item model to use with CustomModelData.
In your case, you'll just need to duplicate an axe model, name it your way and modify it's texture, then add the "overrides" in the diamond axe model with your newly created model.

Keep in mind that this is no basic ressource pack making. If you're a beginner at making .json models, I advise you to take a look at this article from minecraft gamepedia on .json models.
1
06/03/2019 11:36 am
Level 1 : New Miner
Aetheriox
when i try to use the custom model data with custom textures it always gives a missing texture cube, but when i use any ingame item (Ie iron ingot) it works, can you help?
1
06/04/2019 4:24 am
Level 37 : Artisan Engineer
Geegaz
I would need to see your model file (something.json) to fully understand the problem.

But from what I read I may see what's wrong:
To apply a custom texture to an item, you'll need to create a new item model. It's not difficult,
- copy a simple item model and rename it as you want (I'll use "example.json")
- in the model file, replace the texture "layer0" by the texture you want
- in the item model file that uses CustomModelData, write the name of your newly created item model in the "model" field.

This is what your files should look like:
example.json
{
"parent": "item/generated",
"textures": {
"layer0": "folder/your_texture"
}
- note that "item/generated" renders as a normal vanilla item, "item/handheld" is used for swords and "item/handheld_rod" for sticks and blaze rods. Other items need to be manually adjusted to look right in hand but that's another story

iron_ingot.json - or whatever vanilla item you're changing
{
"parent": "item/generated",
"textures": {
"layer0": "item/iron_ingot"
},

"overrides": [
{"predicate": {"custom_model_data":<...>}, "model": "folder/example.json"}
]
}

Let me know if you still have trouble with it, have a good day !
1
06/07/2019 3:10 pm
Level 1 : New Miner
Aetheriox
my code is this
{
"parent": "item/handheld_rod",
"textures": {
"layer0": "item/carrot_on_a_stick"
},

"overrides": [
{"predicate": {"custom_model_data": 1}, "model": "item/1"}

]

}


i have the custom texture in the correct folder it just wont show it
2
05/29/2019 6:38 pmhistory
Level 10 : Journeyman Dragon
Lastphysics
Hey, just used the Custom Model Data, works good, but not on tridents. The picture in the inventory is the custom model, but the items in hand is the original one :/.
I putted a bug report, but its probably something more about an "entity" rather rhan an "item".
Do you know how to use custom model data with entities ?
1
06/01/2019 3:44 pmhistory
Level 37 : Artisan Engineer
Geegaz
Useful question, I needed to search a bit to find an answer. The trident actually has 4 different models:
- trident.json, the one you changed and renders the model in the inventory
- trident_in_hand.json, when you have it in your hand (the one that was bothering you)
- trident_throwing.json, when you raise your arm to throw it
- a hardcoded entity model for the entity that is thrown

I reccomend you reading this to learn more about it and for an example pack.
Have a nice day !
1
06/01/2019 3:54 pm
Level 59 : Grandmaster Artist
oakar258
As far as I know changing entity models is not possible in vanilla - Optifine is required
1
06/01/2019 4:46 pm
Level 37 : Artisan Engineer
Geegaz
Exactly.
For the trident you'll need to work on the texture to fake a model.

BUT there is one kind of entity affected by CustomModelData: projectiles (snowball, splash potions, fireworks...).
They are rendered the same way as items, so changing the model of a projectile item will change the projectile entity.
1
06/02/2019 7:30 pm
Level 10 : Journeyman Dragon
Lastphysics
Thanks a lot, and its gonna be to difficult to do ^^ not enough time and energy for that ^^    
  
But it answered a good question I had.

Thanks again.

(If you have some time : https://www.planetminecraft.com/forums/minecraft/discussion/match-tool-question-json-conditi-588286/ , thats another post about the new 1.14 condition "match_tool" )
4
05/27/2019 1:15 pm
Level 1 : New Miner
Kirse88
Can I ask how to make custom texture for bow? I've been struggling whole evening and I still don't have it right.
1
05/29/2019 1:43 pm
Level 37 : Artisan Engineer
Geegaz
That's a good, and rather difficult question !

To add custom model to a bow (I'm saying model, but a model can be just a texture change), you need to change the "predicate:{}" part of the bow.json file to use custom_model_data.
See this thread on Minecraft forum for better explainations, just replace "damage:" by "custom_model_data:" in "predicate:{}".

Hope that helped, have a good day ^^
2
05/31/2019 10:22 amhistory
Level 36 : Artisan Miner
samo_lego
Hi! I've been messing with that too, and ... I can't get it to work. Custom models work for me, but only if I delete the "normal" / "vanilla" bow lines. If I put them back, the stationary bows are fine, however, once you start to charge them, they default to the vanilla bow. As mentioned, if I remove lines for vanilla bow, all of them work, just the vanilla one doesn't. Any ideas?

EDIT: Well, I was silly, I put custom lines BEFORE the vanilla ones. If anyone finds it useful :-)
1
06/05/2019 2:02 amhistory
Level 1 : New Explorer
TheFalc
Hi, I'm trying to mess with custom bows too, could you please show me the .JSON files, I can't get it to work, at first I thought it was a comma, then a predicate, then this and then that. I've been working on this for like 3 day by now.

For the bow.json file, I've written this:
{
"parent": "item/generated",
"textures": {
"layer0": "item/bow"
},
"display": {
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
},
"overrides":
[
{"predicate": {"pulling": 1}, "model": "item/bow_pulling_0"},
{"predicate": {"pulling": 1, "pull": 0.65}, "model": "item/bow_pulling_1"},
{"predicate": {"pulling": 1, "pull": 0.9}, "model": "item/bow_pulling_2"},

{"predicate": {"custom_model_data":819}, "model": "item/bow/1"},
{"predicate": {"custom_model_data":819, "pulling": 1}, "model": "item/bow/2"},
{"predicate": {"custom_model_data":819, "pulling": 1, "pull": 0.65},"model": "item/bow/3"},
{"predicate": {"custom_model_data":819, "pulling": 1, "pull": 0.9}, "model": "item/bow/4"},
{"predicate": {"custom_model_data":819, "pulling": 1, "pull": 1.0}, "model": "item/bow/5"}
]
}
For the individual models of the bow states, I've written this: (i show you just the first one because they are all the same)
{
"parent": "item/bow",
"textures": {
"layer0": "item/bow/1"
}
}
And last I have an image of the file tree I'm using at the moment:

└───minecraft
├───models
│ └───item
│ │ bow.json
│ │
│ └───bow
│ 1.json
│ 2.json
│ 3.json
│ 4.json
│ 5.json

└───textures
├───entity
│ └───illager
│ illusioner.png

└───items
└───bow
1.png
2.png
3.png
4.png
5.png
I would really appreciate it if you could help me :)
2
06/06/2019 2:09 am
Level 37 : Artisan Engineer
Geegaz
For now I can't see what's wrong, may be a simple mistake in the order you put your predicates (try putting your custom lines between normal ones, a custom state right after the vanilla state).
And please, describe more precisely how it is "not working" (does it always give an error model ? Does the CustomModelData show always the vanilla bow ?).
Good luck !
1
06/06/2019 12:53 pmhistory
Level 1 : New Explorer
TheFalc
Thanks for the reply. I'll give a try to your advice. My problems is that bows without this custom model data have the vanilla texture, but those who have the code "819" are not working, they have that black and pink error texture, not the error block, the error texture.

Here is an pic of the situation
2
01/02/2019 2:06 pmhistory
Level 36 : Artisan Robot
Nitrox Nova
Just stumbled across this after reading the wiki documentation, the download is greatly appreciated!
3
10/31/2018 8:47 am
Level 49 : Master Batman
Knux
i'm really surprised that hardly anyone has addressed this impactful moment for minecraft creators

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome