#Issue with CustomModelData after 1.21.10 update

51 messages · Page 1 of 1 (latest)

eager moss
#

Hello,

I’ve been working with 3D modeling in Minecraft for a while, but since updating my Disney server from 1.20.4 to 1.21.10, I can no longer get my CustomModelData to work.

I use 3D models through a resource pack with the Custom Model Data system, but my custom items no longer display correctly in-game.

The command I used previously was:

/minecraft:give draki2405 minecraft:carrot_on_a_stick{CustomModelData:6}

However, in 1.21.10, this command no longer works and the models are not applied anymore.

What is causing this issue?
Has the CustomModelData system changed in Minecraft 1.21+?
How can I fix this to reuse my 3D models on this version?

Thanks for your help

covert fieldBOT
#
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.

sonic agate
#

The new system even allows you to make item independent models (so a model you can apply to any item you wish ingame via a command), which also won't clash with other packs (assuming you didn't use the exact same namespace and file name)

#

Ofc custom model data itself is still an option too, though imo item_model (what I just described) is easier to set up.

eager moss
sonic agate
# eager moss Thanks for the explanations! I’d really like to understand this item_model syst...

you just create an item definition .json file in assets/namespace/items/example.json and put this inside:
-# (don't confuse the items folder with models/item!)

{
  "model": {
    "type": "minecraft:model",
    "model": "namespace:item/example"
  }
}```
and ingame you can then use the item_model component to assign that item definition file to an item like:
`/give @s stick[item_model="namespace:example"]`
#

Ofc your item definition file can be more complex than what i have shown (for bows etc. that swaps models depending on certain criteria)
and instead of namespace you write your own namespace ofc.

#

Meanwhile, if you wanna stay with the custom_model_data component you'd need to overwrite a default item definition file (like stick.json) and replace it with something like this:

{
  "model": {
    "type": "minecraft:range_dispatch",
    "property": "minecraft:custom_model_data",
    "entries": [
      {
        "threshold": 1,
        "model": {
          "type": "minecraft:model",
          "model": "namespace:item/a"
        }
      },
      {
        "threshold": 2,
        "model": {
          "type": "minecraft:model",
          "model": "namespace:item/b"
        }
      }
    ],
    "fallback": {
      "type": "minecraft:model",
      "model": "minecraft:item/stick"
    }
  }
}```
(the part in "fallback" would be the information that would usually be in the default item definition file of the respective item)
eager moss
sonic agate
#

I personally prefer item_model more, but it's completely up to you which one to use.

#

only difference is that with the item_model component you will see an error cube if the pack isn't equipped (which can be an upside or a downside depending on who you ask)

eager moss
sonic agate
#

define "make the different manipulations for item_model"

#

and both files I sent are working examples
-# (besides the model paths you'd need to adjust to your own models ofc)

eager moss
sonic agate
#

oh wait

#

it's cause you have the Essentials plugin (or similar)

#

that shitty plugin screws with vanilla commands for no reason

#

you need to use /minecraft:give in that case

eager moss
sonic agate
#

k, now show what's inside your stone_hoe.json

sonic agate
#

and you have a model called "stone_hoe" in assets/test/models/item/ ?

eager moss
#

Maybe I must remoove the "s" from item

sonic agate
#

that's not what I asked

#

no

sonic agate
# eager moss Here is

I'm asking if you also have a MODEL .json file in assets/test/models/item/ called stone_hoe.
Cause right now that's what you are telling the game with this file in your screenshot here

eager moss
sonic agate
#

that was my question

#

I asked whether you have that model file
then you said "yeah, look here on the screen", which showed me item defintion file in the items folder, not the model file

eager moss
sonic agate
#

Just wanted to know whether the file is there or not.

#

can you send a screenshot where I see the file in the file explorer (just like you did for the other file earlier)

eager moss
sonic agate
#

that's not how that works

#

that's an item definition file

#

which is (correctly) in the items folder

#

The MODEL file is the .json file you get from Blockbench and put within the models folder (models/item usually)

#

There need to be 2 stone_hoe.json files (in your case).
One in the items folder and one in the models/item folder. Those are two completely separate files with completely different content. One defined what model the game uses and the other is a model file.
Not every .json file is a model file. I can write my shopping list in .json, but it won't make it a model file.

eager moss
eager moss
sonic agate
eager moss
eager moss
sonic agate
#

and

{
  "model": {
    "type": "minecraft:model",
    "model": "stone_hoe:item/stone_hoe",
    "property": "minecraft:component"
  }
}```
is not correct for your ITEM DEFINITION file
it needs to be
```json
{
  "model": {
    "type": "minecraft:model",
    "model": "test:item/stone_hoe"
  }
}```
eager moss