EliteFantasy ResourcePack Guide
  • ResourcePack Guide
    • Introduction
    • Beginning
      • lang
      • sounds
      • texts
      • particles
      • atlases
      • fonts
      • blockstates
      • textures
        • Equipment
        • Entity Textures
      • models
        • Blockbench Models
        • ItemsModels & CustomModelData
          • custommodeldata (old)
          • custommodeldata extras (old)
        • Understanding the system the new item system
      • shaders
  • Components Guide
    • Introduction
      • Components
  • Discord
    • Discord
Powered by GitBook
On this page
  • Item Model Component
  • Give Command
  • CustomModelData Examples
  • Give Command
  • More Items Examples
  • Example of 2D Item in Inventory and 3D Item in Hand
  • Example of eating animation
  • Items with custommodeldata that change according to a date
  1. ResourcePack Guide
  2. Beginning
  3. models

ItemsModels & CustomModelData

PreviousBlockbench ModelsNextcustommodeldata (old)

Last updated 3 months ago

In the new versions of Minecraft they changed things about the CustomModelData and now they are located in the items folder, this allows adding a component in the item to change its model.

Item Model Component

This is a new component added in 1.21.3, but in 1.21.4 it has been modified, is a way to use an different from those already created or modifying the existing ones, in this case the component references to assets/<namespace>/items/<id> and would be used as <namespace>:<id>

📦resource_pack.zip
  └── 📁assets
       └── 📁minecraft
           └── 📁items
               └── 📁📑some_item.json

In 1.21.3 referenced to assets/<namespace>/models/item/<id>

Give Command

/give @p diamond[item_model='minecraft:some_item'] 1

CustomModelData Examples

📦resource_pack.zip
  └── 📁assets
       └── 📁minecraft
           ├── 📁items
           │    └── 📑diamond.json
           └── 📁models
               └── 📁item
                    └── 📑awesome_item.json

diamond.json

{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:custom_model_data",
        "entries": [
            {
                "threshold": 1382,
                "model": {
                    "model": "minecraft:item/awesome_item",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond"
        }
    }
}

Give Command

/give @p diamond[custom_model_data={floats:[1382]}] 1

More Items Examples

Example of 2D Item in Inventory and 3D Item in Hand

{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:custom_model_data",
        "entries": [
            {
                "threshold": 1381,
                "model": {
                    "property": "select",
                    "type": "minecraft:display_context",
                    "cases": [
                        {
                            "when": [
                                "gui",
                                "fixed"
                            ],
                            "model": {
                                "type": "minecraft:model",
                                "model": "minecraft:item/diamond_pickaxe"
                            }
                        },
                        {
                            "when": [
                                "thirdperson_lefthand",
                                "thirdperson_righthand",
                                "ground",
                                "none"
                            ],
                            "model": {
                                "type": "minecraft:model",
                                "model": "minecraft:item/diamond_sword"
                            }
                        }
                    ]
                }
            },
            {
                "threshold": 1382,
                "model": {
                    "model": "minecraft:item/awesome_item",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/stone_sword"
        }
    }
}

Example of eating animation

📦resource_pack.zip
  └── 📁assets
       ├── 📁minecraft
       │    └── 📁items
       │        └── 📑apple.json
       └── 📁elitefantasy
            ├── 📁models
            │     └── 📁custom
            │          └── 📁items
            │               └── 📁food
            │                    ├──📑apple_rotated_to_mouth.json
            │                    ├── 📑apple_eat_1.json
            │                    ├── 📑apple_eat_2.json
            │                    ├── 📑apple_eat_3.json
            │                    ├── 📑apple_eat_4.json
            │                    ├── 📑apple_eat_5.json
            │                    └── 📑apple_eat_6.json
            └── 📁textures
                 └── 📁custom
                      └── 📁items
                           └── 📁food
                                ├── 🎨apple_eat_1.png
                                ├── 🎨apple_eat_2.png
                                ├── 🎨apple_eat_3.png
                                ├── 🎨apple_eat_4.png
                                ├── 🎨apple_eat_5.png
                                └── 🎨apple_eat_6.png

apple.json

{
  "model": {
    "type": "minecraft:select",
    "property": "minecraft:display_context",
    "cases": [
      {
        "when": "gui",
        "model": {
          "type": "minecraft:model",
          "model": "minecraft:item/apple"
        }
      }
    ],
    "fallback": {
      "type": "minecraft:condition",
      "property": "minecraft:using_item",
      "on_false": {
        "type": "minecraft:model",
        "model": "minecraft:item/apple"
      },
      "on_true": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:use_duration",
        "remaining": true,
        "scale": 1,
        "entries": [
          {
            "model": {
              "type": "minecraft:model",
              "model": "elitefantasy:custom/items/food/apple_eat_6"
            },
            "threshold": 2
          },
          {
            "model": {
              "type": "minecraft:model",
              "model": "elitefantasy:custom/items/food/apple_eat_5"
            },
            "threshold": 6
          },
          {
            "model": {
              "type": "minecraft:model",
              "model": "elitefantasy:custom/items/food/apple_eat_4"
            },
            "threshold": 10
          },
          {
            "model": {
              "type": "minecraft:model",
              "model": "elitefantasy:custom/items/food/apple_eat_3"
            },
            "threshold": 14
          },
          {
            "model": {
              "type": "minecraft:model",
              "model": "elitefantasy:custom/items/food/apple_eat_2"
            },
            "threshold": 18
          },
          {
            "model": {
              "type": "minecraft:model",
              "model": "elitefantasy:custom/items/food/apple_eat_1"
            },
            "threshold": 22
          },
          {
            "model": {
              "type": "minecraft:model",
              "model": "elitefantasy:custom/items/food/apple_rotated_to_mouth"
            },
            "threshold": 26
          }
        ],
        "fallback": {
          "type": "minecraft:model",
          "model": "elitefantasy:custom/items/food/apple_eat_6"
        }
      }
    }
  }
}

Items with custommodeldata that change according to a date

This would be an example with Christmas

{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:custom_model_data",
        "entries": [
            {
                "threshold": 1382,
                "model": {
                    "type": "minecraft:select",
                    "pattern": "MM-dd",
                    "property": "minecraft:local_time",
                    "cases": [
                        {
                            "model": {
                                "type": "minecraft:model",
                                "model": "minecraft:item/some_item_christmas"
                            },
                            "when": [
                                "12-24",
                                "12-25",
                                "12-26"
                            ]
                        }
                    ],
                    "fallback": {
                        "model": {
                            "type": "minecraft:model",
                            "model": "minecraft:item/some_item"
                        }
                    }
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond"
        }
    }
}

custom_model_data Component Tutotial !

item model
Here
3KB
bow.json
Bow Examples
6KB
crossbow.json
Crossbow Examples
2KB
fishing_rod.json
Fishing Rod Examples
2KB
shield.json
Shield Item Examples