#Help with adding model data

20 messages · Page 1 of 1 (latest)

deep galeBOT
#
Welcome to the help forum!

Please make sure to read #1029373817119838218 as it may answer your question!

Once your question has been resolved, please mark the post as closed by using the </close:1163944441741049897> command.

crimson valve
#

CustomModelData is for items only

round ferry
crimson valve
round ferry
#

My apologies 1.21.1

crimson valve
deep galeBOT
# crimson valve !faq custom_model_data
FAQ
Java: Custom Model Data

Disclaimer: This only works for items (not placed blocks!) and only if you are in Java Edition 1.14 or later!

Example

To give, for example, a stick more models you would have something like this in YourResourcePack/assets/minecraft/models/item and call it stick.json.

stick.json

{
    "parent": "item/generated",
    "textures": {
        "layer0": "item/stick"
    },
    "overrides": [
        { "predicate": {"custom_model_data": 1}, "model": "item/custom_stick"},
        { "predicate": {"custom_model_data": 2}, "model": "custom/branch"},
        { "predicate": {"custom_model_data": 3}, "model": "block/stone"}
    ]
}``` 
That would give the stick 3 additional models it could have.

If you use something else than a stick replace the parts before "overrides" with the exact same information the default model has (The one in models/**item**, not the one in models/block!)
If the default model also has override entries put them before your custom ones in the "overrides" section (don't forget commas between entries).
Type `!faq default-pack` if you don't know how to get the default assets.


# But can I do it without editing .json manually?
Well, good for you Blockbench can actually add overrides to model files.
So copy the default model of the item you wanna add models to into your pack, then load it into Blockbench.
In Blockbench go to Tools > Edit Override Predicates.
There you can add overrides and define the custom_model_data predicates you wanna add.
See the _General knowledge/tips_ section further down if you don't know how to set the model path here.
After you are done, save/export the .json model again.

# Ingame use
To get the item with a custom model use: `/give <player> stick[custom_model_data=X]` 
_(`/give <player> stick{CustomModelData:X}` for 1.20.5 and older)_


# General knowledge/tips
- A model path is **always** relative to the "models" folder of your pack.
So `"item/custom_stick"` will load the model in `YourPack/assets/minecraft/models/`**`item`** called **custom_stick**.json;
while `"custom/branch"` will load the model in `YourPack/assets/minecraft/models`**`custom`** called **branch**.json;
and so on.
- The predicates have to be ordered from lowest to highest! This is because Minecraft reads the predicates as "this value or higher" and uses the last entry whose predicate checks are fullfilled.
round ferry
#

Do I add that in a new file or edit an existing one? Sorry for all the questions

crimson valve
#

You edit the base model (stick.json or whatever item you plan to add this model to as separate variant)
You don't need to touch your custom model made in BB at all.

round ferry
#

is it possible to get a visual of what im supposed to do with the pack i sent? like you edit it and send it to me to see what im doing wrong? i apologies for being difficult

crimson valve
#

you can show your stick.json (or whatever your base item is) and I can check if there is an error or not

#

or you can send the whole pack (but only if there are no default assets in it)

round ferry
#

unsure of what default mean with this still learning

crimson valve
crimson valve
round ferry
#

how do i fix that? do i make new file for model data? or edit an existing one?

crimson valve
round ferry
#

Thank you so much for helping me again, have an amazing day

#

!close