Custom Items

File Structure

  • Item to Modify: assets/minecraft/models/item - To create a custom item, you will need to modify one of the JSON files located in the Minecraft namespace since you're overriding an existing item's model.

  • Custom Model: assets/your_namespace/models/item - Place your custom model file here.

  • Custom Texture: assets/your_namespace/textures/item - Place your custom texture here.

Modifying the Existing Item Model JSON

  • File: Choose any item to modify and locate its JSON file. For example, if you're customizing a stick, you would edit the assets/minecraft/models/item/stick.json JSON file.

  • Content: Add an overrides section that will select your custom model when the item has a specific CustomModelData.

Inside stick.json:

"overrides": [
  {
    "predicate": { "custom_model_data": 123456 },
    "model": "your_namespace:item/custom_item_model"
  }
]

Code for Plugin Developers

ItemStack item = new ItemStack(Material.STICK);
ItemMeta meta = item.getItemMeta();
meta.setCustomModelData(123456);
item.setItemMeta(meta);
player.getInventory().addItem(item);

Last updated