#1.21.4 Help with Custom Model Data and old models

67 messages ยท Page 1 of 1 (latest)

stark auroraBOT
#
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.

alpine sparrow
#

This is the command I used to give myself a piece of paper with custom model data "moneda".
/give Somnyel minecraft:paper[minecraft:custom_model_data={string:["moneda"]}]

#

This is the item json file where I assigned the model to the custom model data string "moneda"

#

And this is my model, just as blockbench exported it

alpine sparrow
spark moon
#

Other than that I see no reason why it would be invisible.
Does it look like a normal paper when it has no value assigned? or any other value in general?

alpine sparrow
#

Paper texture seems to be missing too...

spark moon
alpine sparrow
#

I made sure. Error persists

spark moon
#

Could you send the pack you are trying to use?

alpine sparrow
#

Maybe you can figure it out

spark moon
#

it goes in assets/minecraft/items

#

cause it's an item definition file, not a model file

alpine sparrow
#

Ah!

#

So I just move it and that's it?

alpine sparrow
spark moon
#

Did you make sure to make the items folder in the "minecraft" folder and not in, for example, the models folder?
Double check by changing item/paper to item/stick in the fallback and see if you see a change ingame.

alpine sparrow
#

So it must be something with the model file.

spark moon
#

if it were a problem with the model file you'd see something that isn't a paper at least

#

also, it works for me after I moved the paper.json to the items folder just fine

#

and the command I used: /give @s paper[minecraft:custom_model_data={"strings":["moneda"]}]

alpine sparrow
#

Ah, I got it working!

#

Thank you!!!

alpine sparrow
spark moon
#

Depends on how detailed you wanna go with your custom shields etc. you wanna go (like, do your custom ones support the predicates too or are they just using the same model for all cases etc.).

alpine sparrow
#

I have different models for each charging phase of my crossbows, and different models for different custom model datas

spark moon
#

this would be an example for adding another elytra item (not the thing rendering on your back, just the item):

{
  "model": {
    "type": "minecraft:range_dispatch",
    "property": "minecraft:custom_model_data",
    "entries": [
      {
        "threshold": 1,
        "model": {
          "type": "minecraft:condition",
          "property": "minecraft:broken",
          "on_true": {
            "type": "minecraft:model",
            "model": "custom/example"
          },
          "on_false": {
            "type": "minecraft:model",
            "model": "custom/example_broken"
          }
        }
      }
    ],
    "fallback": {
      "type": "minecraft:condition",
      "property": "minecraft:broken",
      "on_true": {
        "type": "minecraft:model",
        "model": "minecraft:item/elytra"
      },
      "on_false": {
        "type": "minecraft:model",
        "model": "minecraft:item/elytra_broken"
      }
    }
  }
}```
#

assuming you specifically wanna use custom_model_data and not the item_model component for example

alpine sparrow
#

Woah this looks very intimidating

spark moon
#

well, that's what happens if you multiple options

#

With the item_model you wouldn't have the problem of needing to list everything in one file.
But you would have hte problem that people without the pack will see an error cube.

alpine sparrow
#

Here I'm making a crossbow, but it only lets me use an index, not words like before.

#

I used something like this before (it's longer)

{
    "parent": "items/flintlock/flintlock_idle",
    "overrides": [
        {
            "predicate": {
                "pulling": 1
            },
            "model": "items/flintlock/flintlock_loading_0"
        },
        {
            "predicate": {
                "pulling": 1,
                "pull": 0.167
            },
            "model": "items/flintlock/flintlock_loading_1"
        },
        {
            "predicate": {
                "pulling": 1,
                "pull": 0.5
            },
            "model": "items/flintlock/flintlock_loading_2"
        },
        {
            "predicate": {
                "pulling": 1,
                "pull": 0.7
            },
            "model": "items/flintlock/flintlock_loading_3"
        },
        {
            "predicate": {
                "pulling": 1,
                "pull": 0.8
            },
            "model": "items/flintlock/flintlock_loading_4"
        },
        {
            "predicate": {
                "pulling": 1,
                "pull": 0.9
            },
            "model": "items/flintlock/flintlock_loading_5"
        },
        {
            "predicate": {
                "charged": 1
            },
            "model": "items/flintlock/flintlock_primed"
        },
        {
            "predicate": {
                "charged": 1,
                "firework": 1
            },
            "model": "items/flintlock/flintlock_firework"
        },
alpine sparrow
#

There's different models for each stage of loading it

spark moon
#

you can reference the default crossbow.json (item definition, not model) to see the general layout.

alpine sparrow
#

Ah, okay!

spark moon
#

Ofc you can do more than the default one, it's just a good reference file in general.

alpine sparrow
spark moon
alpine sparrow
alpine sparrow
# spark moon

I got the models to work, but I'm having another problem now. When holding my crossbow with the right model assigned to it, it's in a different position than I want it to be.

#

This is how it's supposed to look.

#

This is how it looks in game.

#

All of the animations are... shifted somehow

alpine sparrow
#

This one is the new one

spark moon
#

might be due to the animation of the arms moving the item around ๐Ÿค” (and there being some desync between Blockbench preview and ingame view)

alpine sparrow
spark moon
#

item definition files don't affect the positioning of models like that though ๐Ÿค”

alpine sparrow
#

I'm sure I'm doing something wrong with the json file.

#

This is what I'm currently doing

#

And this is what minecraft uses by default

spark moon
#

again, the item definition file does not affect how the model is positioned on screen

alpine sparrow
#

So... What should I do then? Move the model in blockbench?

#

i just tried this. it appears that the models are getting assigned wrong, because after reloading and when aiming, stage "0" (begginning of the reload animation) is being applied instead of the "primed" stage, which is the right one for when you're aiming.

alpine sparrow
#

I managed to figure it out, thanks for the pointers!!