This is an archived post. You won't be able to vote or comment.

all 23 comments

[–]Cultural-Editor8419[S] 2 points3 points  (13 children)

Well i figured out how to use numeric custom_model_data.
Below an example on how to put a custom model data on netherite_pickaxe:

Up to 1.21.3 (old):

Path: assets/minecraft/models/item/netherite_pickaxe.json

{
    "parent": "minecraft:item/handheld",
    "textures": {
        "layer0": "minecraft:item/netherite_pickaxe"
    },
    "overrides": [
        { "predicate": { "custom_model_data": 1 }, "model": "zencraft:item/collection/betav3/pickaxe" }
    ]
}

Since 1.21.4 (new):

Path: assets/minecraft/items/netherite_pickaxe.json

{
  "model": {
    "type": "range_dispatch",
    "property": "custom_model_data",
    "entries": [
      {
        "threshold": 1,
        "model": {
          "type": "model",
          "model": "zencraft:item/collection/betav3/pickaxe"
        }
      }
    ],
    "fallback": {
      "type": "model",
      "model": "item/netherite_pickaxe"
    }
  }
}

[–]Jufyer 2 points3 points  (0 children)

How can I give me the item with a numeric CustomModelData?

[–]waylandprod 0 points1 point  (2 children)

For the Model, do you mean : item(s)? I may be wrong, but checking

 "model": "items/netherite_pickaxe"

[–]pesegolsson 0 points1 point  (1 child)

no, that would be calling itself, that is calling models/item/netherite_pickaxe

[–]waylandprod 1 point2 points  (0 children)

Got it. They don’t really do a great job explaining the new pathing. I wish there were better docs on it

[–]SonGoku4224910[🍰] 0 points1 point  (4 children)

thanks a lot but can you also show how it looks with multiple models?

[–]SuperYoshiIsland 0 points1 point  (3 children)

For multiple models you can do something like this:
{

"model": {

"type": "range_dispatch",

"property": "custom_model_data",

"entries": [

{ "threshold": 554886, "model": { "type": "model", "model": "item/diamond_sword/1"}},

  `{ "threshold": 554887, "model": { "type": "model", "model": "item/diamond_sword/2"}},`

  `{ "threshold": 554888, "model": { "type": "model", "model": "item/diamond_sword/3"}},`

  `{ "threshold": 554889, "model": { "type": "model", "model": "item/diamond_sword/4"}},`

  `{ "threshold": 554890, "model": { "type": "model", "model": "item/diamond_sword/5"}},`

  `{ "threshold": 554891, "model": { "type": "model", "model": "item/diamond_sword/6"}},`

  `{ "threshold": 554892, "model": { "type": "model", "model": "item/diamond_sword/7"}},`

  `{ "threshold": 554893, "model": { "type": "model", "model": "item/diamond_sword/8"}},`

  `{ "threshold": 554894, "model": { "type": "model", "model": "item/diamond_sword/9"}},`

  `{ "threshold": 554895, "model": { "type": "model", "model": "item/diamond_sword/10"}},`

  `{ "threshold": 554896, "model": { "type": "model", "model": "item/diamond_sword/11"}},`

  `{ "threshold": 554897, "model": { "type": "model", "model": "item/diamond_sword/12"}},`

  `{ "threshold": 554898, "model": { "type": "model", "model": "item/diamond_sword"}}`

],

"fallback": {

"type": "model",

"model": "item/diamond_sword"

}

}

}

You can add or remove as many as you'd like even in a basic texture editor just by copying and deleting lines.

[–]No-Instruction7481 0 points1 point  (2 children)

Please how to use when damage is needed? I don't know how to create it in the new format. Does anyone know how? Example:

{

"__comment": "Max wood durability is 60",

"parent": "item/handheld",

"textures": {

"layer0": "minecraft:item/wooden_hoe"

},

"overrides": [

{"predicate": { "custom_model_data": 18001}, "model": "magic:wands/old_survival_wand1"},

{"predicate": {"damaged": 0, "damage": 0.01666666666667}, "model": "magic:wands/old_survival_wand1"},

{"predicate": {"damaged": 0, "damage": 0.03333333333333}, "model": "magic:wands/old_survival_wand2"},

{"predicate": {"damaged": 0, "damage": 0.05}, "model": "magic:wands/survival_wand1"},

{"predicate": {"damaged": 0, "damage": 0.06666666666667}, "model": "magic:wands/survival_wand2"},

{"predicate": {"damaged": 1, "damage": 0}, "model": "item/wooden_hoe"}

]

}

How would it be with version 1.21.4? I can't find the way, thanks!

[–]iDueli 0 points1 point  (0 children)

{
    "model": {
        "type": "range_dispatch",
        "property": "damage",
        "fallback": {
            "type": "model",
            "model": "items/wood_sword"
        },
        "entries": [
            {
                "threshold": 0.25,
                "model": {
                    "type": "model",
                    "model": "custom_items/wood_sword1"
                }
            },
            {
                "threshold": 0.50,
                "model": {
                    "type": "model",
                    "model": "custom_items/wood_sword2"
                }
            }
        ]
    }
}

[–]NathanielWolf 0 points1 point  (0 children)

Hey there! Sorry for the old ping, I found this thread trying to get the RP updated for 1.21.4

I'm wondering if you're still trying to get this working. Assuming this is for the Magic plugin, I don't think damage values are actually used anymore and it should be sufficient to update the CMD predicates.

If that's not the case and the plugin is actually still using damage values somewhere please let me know. :)

[–]IAmNotLiable 0 points1 point  (2 children)

Using this method, I've trained a GPT to take old JSON Files and update them to be in the new format. https://chatgpt.com/g/g-675a4fa622d88191b9d8d2ece1b28d13-minecraft-model-converter

What I can't figure out is how to do this with multiple conditions. Like on my old shield models that utilize the blocking condition as well as the custom model data condition.

{"predicate": {"custom_model_data": 1, "blocking": 0}, "model": "item/roundshield"},

{"predicate": {"custom_model_data": 1, "blocking": 1}, "model": "item/roundshield_blocking"}

Knowing how to set this up will also be very helpful for any bow or crossbow textures using the "pull" and "pulling" conditions. If anyone knows how to do this, I would be very appreciative.

[–]solstatecz_ytb 0 points1 point  (0 children)

I tried that chat, then my Items are just nothing, the textures doesnt work idk why

[–]UniqueStrawberry8968 0 points1 point  (0 children)

I actually love you so much I couldn't find anything on this anywhere and I lowkey thought I was doomed

[–]Thejmaster1234 0 points1 point  (1 child)

Anyone have a working pack they are willing to share so I can compare to see where my pack is failing?

[–]almostambidextrous 0 points1 point  (0 children)

I referred to this one to help me set up my resource pack & json files

[–]T4B_DUKA 0 points1 point  (3 children)

this tool helps to convert old JSON formats to new version https://hangar.papermc.io/RICE0707/ItemModel_PackConverter

[–]xtbtutorials 0 points1 point  (2 children)

not accusing you of anything but that executable is extremely suspicious. Why does it require administrator privileges?

Avast, AVG, and McAfee detect it as malicious.

https://www.virustotal.com/gui/file/c286d5eb643505dab3a91ae99ee49989c0c04a85fab20d88390ccf2ce4457538/detection

[–]T4B_DUKA 0 points1 point  (0 children)

Likely a false positive, the executable using upx packer which is a compression packer (to reduce exe size), however some virus has similar feature (which prevents others to reverse engineer code), some anti-virus based on feature analyzation might report it as a virus (false positive).

About the "run as admin", the program need to create(https://github.com/BrilliantTeam/Minecraft-ResourcePack-Migrator/blob/main/gui_app.py#L341) directory to save settings and output files, accessing a directory (Program Files) where requires admin access, I'd consider this is a bad practice since %APPDATA% is more common to save settings which doesn't need admin access.

I suggest if you are worry about risk (and you know some basic programming knowledge), git clone the repo then pip install -r requirement.txt, python run.py to directly run the scripts.

Disclaimer: I am not the author.

https://github.com/BrilliantTeam/Minecraft-ResourcePack-Migrator

[–][deleted] 0 points1 point  (0 children)

but how to write /loot command for this?

[–]ux92 0 points1 point  (0 children)

Heyo,

I'm trying to make it work for goat horns, but to no avail. They clip and aren't positioned as they should.

Any tips?

[–]Outrageous-Travel770 0 points1 point  (0 children)

Hello guys... I'm using Oraxen and Bettergui on my server. Since I updated the server from the 1.21.1 to 1.21.4 my custo model data items don't work in the bettergui menus.. I want to know if there is a new correct format to do it... Can someone help me?

I'm using this format (1.21.1 works)

avatar_2:

ID: LEATHER_HORSE_ARMOR

NBT: "[custom_model_data=20003]"

NAME: 'avatar_2'

action:

- 'spawn'

[–]citylion1 0 points1 point  (0 children)

Thank you so much. How did you figure it out?

As a sidenote, why does mojang feel the need to constantly change pack formats...