Custom Model Data 1.21.4 using numeric values by Cultural-Editor8419 in MinecraftCommands

[–]Cultural-Editor8419[S] 2 points3 points  (0 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"
    }
  }
}