├── .gitignore ├── CustomModelDataGuide ├── assets │ ├── item_model_guide │ │ ├── items │ │ │ └── uno_reverse.json │ │ ├── models │ │ │ └── item │ │ │ │ └── uno_reverse.json │ │ └── textures │ │ │ └── item │ │ │ └── uno_reverse.png │ └── minecraft │ │ └── items │ │ └── iron_nugget.json ├── pack.mcmeta └── pack.png ├── ItemModelGuide ├── assets │ └── item_model_guide │ │ ├── items │ │ └── uno_reverse.json │ │ ├── models │ │ └── item │ │ │ └── uno_reverse.json │ │ └── textures │ │ └── item │ │ └── uno_reverse.png ├── pack.mcmeta └── pack.png └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea/.gitignore 2 | /.idea/CustomModelDataGuide.iml 3 | /.idea/misc.xml 4 | /.idea/modules.xml 5 | /.idea/vcs.xml 6 | -------------------------------------------------------------------------------- /CustomModelDataGuide/assets/item_model_guide/items/uno_reverse.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "item_model_guide:item/uno_reverse" 5 | } 6 | } -------------------------------------------------------------------------------- /CustomModelDataGuide/assets/item_model_guide/models/item/uno_reverse.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "item_model_guide:item/uno_reverse" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CustomModelDataGuide/assets/item_model_guide/textures/item/uno_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplexity-Development/Custom_Model_Data_Guide/d8d42d1b348395f492a8e3ad7a713569d0795a6c/CustomModelDataGuide/assets/item_model_guide/textures/item/uno_reverse.png -------------------------------------------------------------------------------- /CustomModelDataGuide/assets/minecraft/items/iron_nugget.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:select", 4 | "property": "minecraft:custom_model_data", 5 | "cases": [ 6 | { 7 | "when": "uno_reverse", 8 | "model": { 9 | "type": "minecraft:condition", 10 | "property": "minecraft:selected", 11 | "on_true": { 12 | "type": "minecraft:model", 13 | "model": "item_model_guide:item/uno_reverse" 14 | }, 15 | "on_false": { 16 | "type": "minecraft:model", 17 | "model": "minecraft:item/iron_nugget" 18 | } 19 | } 20 | }, 21 | { 22 | "when": "uno_reverse_layered", 23 | "model": { 24 | "type": "minecraft:composite", 25 | "models": [ 26 | { 27 | "type": "minecraft:model", 28 | "model": "item_model_guide:item/uno_reverse" 29 | }, 30 | { 31 | "type": "minecraft:model", 32 | "model": "minecraft:item/red_stained_glass_pane" 33 | } 34 | ] 35 | } 36 | } 37 | ], 38 | "fallback": { 39 | "type": "minecraft:model", 40 | "model": "minecraft:item/iron_nugget" 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /CustomModelDataGuide/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "pack_format": 46, 4 | "description": "Custom Model Data Basic Guide" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CustomModelDataGuide/pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplexity-Development/Custom_Model_Data_Guide/d8d42d1b348395f492a8e3ad7a713569d0795a6c/CustomModelDataGuide/pack.png -------------------------------------------------------------------------------- /ItemModelGuide/assets/item_model_guide/items/uno_reverse.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "item_model_guide:item/uno_reverse" 5 | } 6 | } -------------------------------------------------------------------------------- /ItemModelGuide/assets/item_model_guide/models/item/uno_reverse.json: -------------------------------------------------------------------------------- 1 | { 2 | "parent": "minecraft:item/generated", 3 | "textures": { 4 | "layer0": "item_model_guide:item/uno_reverse" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ItemModelGuide/assets/item_model_guide/textures/item/uno_reverse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplexity-Development/Custom_Model_Data_Guide/d8d42d1b348395f492a8e3ad7a713569d0795a6c/ItemModelGuide/assets/item_model_guide/textures/item/uno_reverse.png -------------------------------------------------------------------------------- /ItemModelGuide/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "pack_format": 46, 4 | "description": "Item Model Basic Guide" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ItemModelGuide/pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Simplexity-Development/Custom_Model_Data_Guide/d8d42d1b348395f492a8e3ad7a713569d0795a6c/ItemModelGuide/pack.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Different Ways To Do Custom Textures In Game 2 | 3 | In Minecraft 1.21.4, new ways of handling custom textures were introduced. This has made it far simpler to add custom 4 | textures to the game. 5 | 6 | If this is your first time adding custom textures, the **Item Model** method will likely be enough. If you need specific 7 | textures based on specific cases, **Custom Model Data** will be necessary 8 | 9 | If you have previously done custom model data, you no longer need to declare a new item texture as 'connected' to any 10 | specific item in the game at all. You can just add the custom item model and texture and then you can apply that to any 11 | item in the game. "Custom Model Data" now is very useful for changing texture based on specific contexts around a 12 | specific item (such as if it's enchanted with a specific thing, named a certain way, etc) but is no longer necessary for 13 | just changing the texture and model of an item. 14 | 15 | # Custom Item 16 | 17 | You are going to need 3 things for a custom item: 18 | 19 | - Item Declaration 20 | - Model file 21 | - Texture 22 | 23 | For the structure of your resource pack, you will have two folders - `` is your name you choose for your 24 | pack. It should not have any spaces or capital letters. If you are new to making stuff with paths and namespaces, check 25 | out [Resource Locations In Minecraft](https://minecraft.wiki/w/Resource_location) 26 | 27 | - `/assets//items/` 28 | - `/assets//models/item/` 29 | - `/assets//textures/item/` 30 | 31 | If you used something like [Block Bench](https://www.blockbench.net/) to make your item, export as a model and export 32 | your texture. 33 | 34 | ### Item Declaration 35 | 36 | With the new system, you will be making an item declaration. This is extremely easy, it just tells the game what type of 37 | model the item is going to be using. For basic item models, it will just look like this: 38 | 39 | ```json 40 | { 41 | "model": { 42 | "type": "minecraft:model", 43 | "model": ":item/" 44 | } 45 | } 46 | ``` 47 | 48 | So for our item declaration, we will have: 49 | 50 | ```json 51 | { 52 | "model": { 53 | "type": "minecraft:model", 54 | "model": "item_model_guide:item/uno_reverse" 55 | } 56 | } 57 | ``` 58 | 59 | This file will go into the `assets//items/` directory. 60 | 61 | ### Model 62 | 63 | If you are making a basic item model, it will look something like this: 64 | 65 | ```json 66 | { 67 | "parent": "", 68 | "textures": { 69 | "layer0": ":item/" 70 | } 71 | } 72 | ``` 73 | 74 | `"parent"` refers to the 'parent' (lol) file that will be used as a reference for things like scale, angle, way it's 75 | held and placed in relation to the character, that the model will be rendered in the game. 76 | 77 | - `"minecraft:item/generated"` - most items in the game (sticks, potatoes, whatever) 78 | - `"minecraft:item/handheld"` - items that are held by the player and used i.e. tools, weapons 79 | - `"minecraft:item/template_bed"` - beds 80 | If I missed any item parent models please let me know. There are many block parent models but I will not be covering 81 | those as there is currently no natively-supported way to add custom blocks into the game. 82 | 83 | so for our item we want to put the parent as `"minecraft:item/generated"` - since it will just be an item that is held 84 | normally, no special properties or anything. 85 | 86 | ```json 87 | { 88 | "parent": "minecraft:item/generated" 89 | } 90 | ``` 91 | 92 | Then for the texture, we have one texture that is referenced for this item. We will make the `"textures"` group 93 | 94 | ```json 95 | { 96 | "parent": "minecraft:item/generated", 97 | "textures": { 98 | "layer0": "" 99 | } 100 | } 101 | ``` 102 | 103 | Then we will add the reference for the texture as `"layer0"` - since I am putting the texture into our namespace, I will 104 | also need to specify that. If you are referencing a default Minecraft texture, you would use the `minecraft` namespace 105 | in this declaration. So if you are using oak planks as a texture in your item's model, you would do 106 | `"minecraft:block/oak_planks"` 107 | 108 | ```json 109 | { 110 | "parent": "minecraft:item/generated", 111 | "textures": { 112 | "layer0": "item_model_guide:item/uno_reverse" 113 | } 114 | } 115 | ``` 116 | 117 | Next, make sure you have placed your textures into `assets//textures/item/` 118 | They must be named the way they have been referenced in the model file (outside of the file end i.e. png) 119 | 120 | So for this, I must have placed a texture image called `uno_reverse.png` into the folder 121 | `assets/item_model_guide/textures/item/` 122 | 123 | If you do not need to change textures based on specific fancy contexts, you can skip to [Final Touches](#final-touches) 124 | 125 | # Custom Model Data 126 | 127 | If you are wanting to adjust textures based on certain circumstances, you'll wanna use custom model data. 128 | If you are *only* going to be using custom model data, you do not need the item declaration, but having it will allow you to use the item model in other areas. 129 | 130 | ## Base Model 131 | 132 | Open the original model file you're basing off of. Original models usually look like this: 133 | 134 | ```json 135 | { 136 | "model": { 137 | "type": "minecraft:model", 138 | "model": "minecraft:item/iron_nugget" 139 | } 140 | } 141 | ``` 142 | 143 | After 1.21.4, custom model data has gotten a lot more flexible, but also requires more things to be added. 144 | 145 | So first, change the `"type": "minecraft:model"` to be ```"type": "minecraft:select"```, and remove the next line. It 146 | should look like this now: 147 | '`minecraft:select`' is the setup that allows us to choose different textures based on different things in game. 148 | 149 | ```json 150 | { 151 | "model": { 152 | "type": "minecraft:select" 153 | } 154 | } 155 | ``` 156 | 157 | Now, add on the next line - ```"property": "minecraft:custom_model_data",``` 158 | 159 | ```json 160 | { 161 | "model": { 162 | "type": "minecraft:select", 163 | "property": "minecraft:custom_model_data" 164 | } 165 | } 166 | ``` 167 | 168 | then you add the 'fallback' texture, so basically the texture this used to point to. In this case, iron nugget. Add 169 | `"fallback": {}` and then basically the original contents of the file into the brackets 170 | 171 | ```json 172 | { 173 | "model": { 174 | "type": "minecraft:select", 175 | "property": "minecraft:custom_model_data", 176 | "fallback": { 177 | "type": "minecraft:model", 178 | "model": "minecraft:item/iron_nugget" 179 | } 180 | } 181 | } 182 | ``` 183 | 184 | Now for the actual declaration of the custom data, we need to add '`"cases":[{}]`' for the different cases that will be 185 | shown. i.e. the different models that will be shown. 186 | 187 | ```json 188 | { 189 | "model": { 190 | "type": "minecraft:select", 191 | "property": "minecraft:custom_model_data", 192 | "cases": [ 193 | {} 194 | ], 195 | "fallback": { 196 | "type": "minecraft:model", 197 | "model": "minecraft:item/iron_nugget" 198 | } 199 | } 200 | } 201 | ``` 202 | 203 | Now inside the `{}` we're gonna add `"when": ` - this will be the name of the custom data, this will be used in 204 | any commands, recipes, etc to tell the game 'Hey **this** item is special and will need to be altered based on special 205 | things' - and prevents the original game items from being broken. 206 | 207 | ```json 208 | { 209 | "model": { 210 | "type": "minecraft:select", 211 | "property": "minecraft:custom_model_data", 212 | "cases": [ 213 | { 214 | "when": "uno_reverse" 215 | } 216 | ], 217 | "fallback": { 218 | "type": "minecraft:model", 219 | "model": "minecraft:item/iron_nugget" 220 | } 221 | } 222 | } 223 | ``` 224 | 225 | Then we're gonna add the information for what situations we want this texture to change in. This goes under the`"model"` 226 | section after the `"when"`. The type will be `"minecraft:condition"`. 227 | 228 | Next will be `"property"`. You can get some ideas on what is 229 | available [here](https://minecraft.wiki/w/Items_model_definition#condition). For the purposes of this tutorial, I am 230 | going to choose `"selected"` - which just means 'it is highlighted in the hotbar' 231 | 232 | ```json 233 | { 234 | "model": { 235 | "type": "minecraft:select", 236 | "property": "minecraft:custom_model_data", 237 | "cases": [ 238 | { 239 | "when": "uno_reverse", 240 | "model": { 241 | "type": "minecraft:condition", 242 | "property": "minecraft:selected" 243 | } 244 | } 245 | ], 246 | "fallback": { 247 | "type": "minecraft:model", 248 | "model": "minecraft:item/iron_nugget" 249 | } 250 | } 251 | } 252 | ``` 253 | 254 | Next, will be `"on_true"` which is where we'll put the path to the custom model. This code tells the game which model 255 | file to look for. The model file should be in the `assets//models/item` folder. 256 | 257 | ```json 258 | { 259 | "model": { 260 | "type": "minecraft:select", 261 | "property": "minecraft:custom_model_data", 262 | "cases": [ 263 | { 264 | "when": "uno_reverse", 265 | "model": { 266 | "type": "minecraft:condition", 267 | "property": "minecraft:selected", 268 | "on_true": { 269 | "type": "minecraft:model", 270 | "model": "item_model_guide:item/uno_reverse" 271 | } 272 | } 273 | } 274 | ], 275 | "fallback": { 276 | "type": "minecraft:model", 277 | "model": "minecraft:item/iron_nugget" 278 | } 279 | } 280 | } 281 | ``` 282 | 283 | I am also going to need an `"on_false"` section, which in this example will just show the fallback model. 284 | 285 | ```json 286 | { 287 | "model": { 288 | "type": "minecraft:select", 289 | "property": "minecraft:custom_model_data", 290 | "cases": [ 291 | { 292 | "when": "uno_reverse", 293 | "model": { 294 | "type": "minecraft:condition", 295 | "property": "minecraft:selected", 296 | "on_true": { 297 | "type": "minecraft:model", 298 | "model": "item_model_guide:item/uno_reverse" 299 | }, 300 | "on_false": { 301 | "type": "minecraft:model", 302 | "model": "minecraft:item/iron_nugget" 303 | } 304 | } 305 | } 306 | ], 307 | "fallback": { 308 | "type": "minecraft:model", 309 | "model": "minecraft:item/iron_nugget" 310 | } 311 | } 312 | } 313 | ``` 314 | 315 | ### How to use `minecraft:composite` 316 | 317 | The property `minecraft:composite` allows you to layer multiple models on top of each other. 318 | If we wanted to do this in our example, we would set up a list named `models` under the `composite` property: 319 | 320 | ```json 321 | { 322 | "type": "minecraft:composite", 323 | "models": [] 324 | } 325 | ``` 326 | We put the two models into that list. I'm going to use red stained glass pane as the second layer because it's easy to see overlap with the texture we're using. 327 | 328 | ```json 329 | { 330 | "type": "minecraft:composite", 331 | "models": [ 332 | { 333 | "type": "minecraft:model", 334 | "model": "item_model_guide:item/uno_reverse" 335 | }, 336 | { 337 | "type": "minecraft:model", 338 | "model": "minecraft:item/red_stained_glass_pane" 339 | } 340 | ] 341 | } 342 | ``` 343 | 344 | Then we can put this into the item file like this 345 | 346 | ```json 347 | { 348 | "model": { 349 | "type": "minecraft:select", 350 | "property": "minecraft:custom_model_data", 351 | "cases": [ 352 | { 353 | "when": "uno_reverse_layered", 354 | "model": { 355 | "type": "minecraft:composite", 356 | "models": [ 357 | { 358 | "type": "minecraft:model", 359 | "model": "item_model_guide:item/uno_reverse" 360 | }, 361 | { 362 | "type": "minecraft:model", 363 | "model": "minecraft:item/red_stained_glass_pane" 364 | } 365 | ] 366 | } 367 | } 368 | ], 369 | "fallback": { 370 | "type": "minecraft:model", 371 | "model": "minecraft:item/iron_nugget" 372 | } 373 | } 374 | } 375 | ``` 376 | 377 | # Final Touches 378 | 379 | You need an mcmeta file or your pack won't work. [misode.github.io](https://misode.github.io/pack-mcmeta/) has a 380 | generator, as well as many other very helpful resources for data/resource packs. 381 | 382 | The mcmeta must simply be named `pack.mcmeta` 383 | If you want to include a pack image, it must be named `pack.png` 384 | These will be in the base folder, so before the assets folder. 385 | You can now copy and paste the base folder into your game's resource pack folder and try loading it. 386 | 387 | # How to get the item in-game 388 | 389 | ## Command 390 | 391 | #### Item Model 392 | 393 | If you just did item model, the command will look like this: 394 | `/give @p [minecraft:item_model=":"]` 395 | 396 | The 'item name' will be the file name you used in step one. You can use *any* item for the item you're giving yourself. 397 | So you can apply this model to any item you want. So in our case: 398 | 399 | `/give @p peony[minecraft:item_model="item_model_guide:uno_reverse"]` 400 | 401 | #### Custom Model Data 402 | 403 | For items where you're using custom model data, you'll be using a slightly different command: 404 | `/give @p [minecraft:custom_model_data={strings:[""]}]` 405 | 406 | The name in this case will be the name you used in the "when" section of the custom model data declaration. 407 | 408 | In our case this would be: 409 | `/give @p minecraft:iron_nugget[minecraft:custom_model_data={strings:["uno_reverse"]}]` 410 | 411 | ## Recipes 412 | 413 | You can use these in a recipe result as well. 414 | 415 | #### Item Model 416 | 417 | Example of how you can use item model in a recipe: 418 | 419 | ```json 420 | { 421 | "type": "minecraft:crafting_shaped", 422 | "category": "misc", 423 | "pattern": [ 424 | " X ", 425 | "X X", 426 | " X " 427 | ], 428 | "key": { 429 | "X": "minecraft:paper" 430 | }, 431 | "result": { 432 | "id": "minecraft:iron_nugget", 433 | "components": { 434 | "minecraft:item_model": "custom_model_data_guide_assets:uno_reverse" 435 | } 436 | } 437 | } 438 | ``` 439 | 440 | #### Custom Model Data 441 | 442 | Making a recipe with custom model data is very similar: 443 | 444 | ```json 445 | { 446 | "type": "minecraft:crafting_shaped", 447 | "category": "misc", 448 | "pattern": [ 449 | " X ", 450 | "X X", 451 | " X " 452 | ], 453 | "key": { 454 | "X": "minecraft:paper" 455 | }, 456 | "result": { 457 | "id": "minecraft:iron_nugget", 458 | "components": { 459 | "minecraft:custom_model_data": { 460 | "strings": [ 461 | "uno_reverse" 462 | ] 463 | } 464 | } 465 | } 466 | } 467 | ``` 468 | 469 | ### It's not working! 470 | 471 | - Use your debug option on your launcher, it'll help a ton. It'll tell you exactly what's wrong. 472 | - Make sure all your paths are named correctly. A lot of the directories have changed from being plural to being 473 | singular. This will be the main reason things are messed up, 99% of the time. 474 | - Make sure you have all your declarations in. Item, model, texture. 475 | 476 | ## References 477 | 478 | - [mcmeta](https://github.com/misode/mcmeta) 479 | - [Misode's Stuff](https://misode.github.io/) 480 | - [Minecraft Wiki - Item Model Definition](https://minecraft.wiki/w/Items_model_definition) 481 | - [Minecraft Wiki - Data Components](https://minecraft.wiki/w/Data_component_format) 482 | - [McAssetExtractor](https://github.com/rmheuer/McAssetExtractor) 483 | - [JSON Validator](https://jsonlint.com/) 484 | 485 | 486 | ## Thanks to: 487 | - @AJman14 - 'How to use' section suggestion 488 | - @zbirow - 'minecraft:composite' section suggestion --------------------------------------------------------------------------------