|
| 1 | +# Preface |
| 2 | +Custom model data is a feature in Minecraft that allows you to create your own models for items. |
| 3 | +# Prep |
| 4 | +To use custom model data, you need to make sure that all paths are set properly. |
| 5 | +<br>This means that the base model file with the CustomModelData declaration that points to a new model file must be in the same spot it would be in the vanilla datapack. (If you are not sure of where these would be, I suggest looking at [mcassets](https://mcasset.cloud) or [mcmeta](https://github.com/misode/mcmeta)) |
| 6 | +To create a custom model data, you first need to take the original model file and put it into your resource pack. |
| 7 | +<br>This must go into the vanilla namespace. |
| 8 | +<br>Then, create a new folder for your own assets within the assets directory. (for this example I'm going to name it `custom_model_data_guide_assets`.) |
| 9 | +<br>Within this folder, create the initial folders `models`, and `textures`, and an `item` folder within both of those. |
| 10 | + |
| 11 | +## Base Model |
| 12 | +Open the original model file you're basing off of (in this demo we're using an iron nugget) and add the following code: |
| 13 | + |
| 14 | +```json |
| 15 | +"overrides" : [ |
| 16 | +{ "predicate": { "custom_model_data": 1 }, "model": "custom_model_data_guide_assets:item/purpur_item" } |
| 17 | +] |
| 18 | +``` |
| 19 | +This code tells the game which model file to look for. The model file should be in the `assets/<declared namespace>/models/<declared path>` folder. |
| 20 | +<br>For example, if you have a model in `models -> weapons -> swords -> basic -> iron -> noob_sword.json`, it would look like `"model": "your_namespace:weapons/swords/basic/iron/noob_sword"`. |
| 21 | +<br>You should also name your custom model data with a unique prefix number that makes sense to you to avoid conflicts with other custom model data packs. |
| 22 | + |
| 23 | +## New Model |
| 24 | +Then, create a model file in the folder you declared in the previous step. |
| 25 | +<br>This is the json file that tells the game where to place and render the textures. In this file, you are telling the game which texture file(s) to look for. |
| 26 | +<br>The texture file(s) should be in the `assets/<declared namespace>/textures/<declared path>` folder. You can use assets that are already in the game or your own textures. |
| 27 | +<br>If you export a blockbench model file, you might need to manually adjust the texture file assignments in the case that it was not getting the files from the same place that you are getting them in the pack. |
| 28 | + |
| 29 | +### Final |
| 30 | +You need an mcmeta file or your pack won't work. [misode.github.io](https://misode.github.io/pack-mcmeta/) has a generator, as well as many other very helpful resources for data/resource packs. |
| 31 | +<br>The mcmeta must simply be named `pack.mcmeta` |
| 32 | +<br>If you want to include a pack image, it must be named `pack.png` |
| 33 | +### Other Notes |
| 34 | +It's important to note that if you have multiple custom model data declarations on one item, you must declare them in numerical order or it will break. |
| 35 | + |
| 36 | +### It's not working! |
| 37 | +Use your debug option on your launcher, it'll help a ton. It'll tell you exactly what's wrong. |
| 38 | + |
| 39 | +* It's not showing up at all, it just looks normal! |
| 40 | + * Your model data is either declared wrong, or your pack is not loading. |
| 41 | + |
| 42 | +* My item is just a huge broken box! |
| 43 | + * You declared the model data, but it's pointing to a broken model |
| 44 | + |
| 45 | +* My item looks right, but it's just the wrong/broken texture! |
| 46 | + * Check the texture declaration in your model. Make sure all paths are correct. |
| 47 | + |
| 48 | +* It's showing up with the wrong item! |
| 49 | + * Make sure you didn't either paste the wrong path, or use the wrong number, or accidentally add a zero/extra number somewhere |
| 50 | + |
| 51 | +* This item is supposed to look like x but it's not the right size! |
| 52 | + * Use blockbench to rescale/try using a different parent |
| 53 | + |
| 54 | +* I made a bow and it only changed the first texture! |
| 55 | + * You will need overrides for all the textures on the bow. I suggest getting someone more qualified to help with complex texture questions |
| 56 | + |
| 57 | + |
0 commit comments