Minecraft Blogs / Tutorial

How to use Custom Model Data in your Resource Pack

  • 2,400 views, 28 today
  • 2
  • 1
netunettu's Avatar netunettu
Level 11 : Journeyman Scribe
2

Custom model data can be used to essentially add a skin to an item by changing it's texture based on a value



You must first need a basic resource pack file and general knowledge of how computer files work in order to follow this tutorial correctly
( You can download a basic resource pack file here >> www.planetminecraft.com/texture-pack/base-resource-pack/ )

In your resource pack file, enter assets>minecraft>textures>item (If any of these folders don't exist make create as you go)
Put your custom item texture inside this folder. It can be larger than 16x16, it just won't look very Minecraft'y
If you just want to make an item look like an existing item, than you don't have to do this

Enter assets>minecraft>models>item>new and make a new file named key.json and paste this code into it:
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "item/key"
}
}
You can change
minecraft:item/generated
to minecraft:item/handheldto make the player hold it more like a sword or a pickaxe

In assets>minecraft>models>item (Just outside the 'new' folder), create a new file named flint.json. This will be the item we are replacing.
Paste this code into flint.json:
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "minecraft:item/flint"
},
"overrides": [
{ "predicate": { "custom_model_data": 1 }, "model": "item/new/key"}
]
}

Apply the resource pack to your game, and execute this command:
/give @s minecraft:flint{CustomModelData:1b}
See here to download the full pack [​link pending]


This will work on blocks too (ONLY BLOCKS IN YOUR INVENTORY, WILL NOT WORK WHEN PLACED IN THE WORLD)
{
"parent": "minecraft:block/sand",
"overrides": [
{ "predicate": { "custom_model_data": 1 }, "model": "item/new/key"}
]
}



A tutorial for applying this feature in your server is coming soon!
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome