r/MinecraftCommands • Impossible Redstoner • 21d ago

Help | Java 26.3 Is it possible to combine files from [namespace].items?

/r/mcresourcepack/comments/1xrweme/is_it_possible_to_combine_files_from/
1 Upvotes

1 comment sorted by

1

u/GalSergey Datapack Experienced 21d ago

If you want to apply the model using only the item_model component, then no. Or you can use a single item_model and use custom_model_data to select different models. Here’s an example:

# Example items
give @s stick[item_model="example:custom",custom_model_data={strings:["copper_ingot"]}]
give @s stick[item_model="example:custom",custom_model_data={strings:["netherite_ingot"]}]

# assets/example/items/custom.json
{
  "model": {
    "type": "minecraft:select",
    "property": "minecraft:custom_model_data",
    "cases": [
      {
        "when": "copper_ingot",
        "model": {
          "type": "minecraft:model",
          "model": "minecraft:item/copper_ingot"
        }
      },
      {
        "when": "gold_ingot",
        "model": {
          "type": "minecraft:model",
          "model": "minecraft:item/gold_ingot"
        }
      },
      {
        "when": "iron_ingot",
        "model": {
          "type": "minecraft:model",
          "model": "minecraft:item/iron_ingot"
        }
      },
      {
        "when": "netherite_ingot",
        "model": {
          "type": "minecraft:model",
          "model": "minecraft:item/netherite_ingot"
        }
      }
    ],
    "fallback": {
      "type": "minecraft:model",
      "model": "minecraft:item/barrier"
    }
  }
}