# ItemsModels & CustomModelData

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 [item model](/components-guide/introduction/components.md#item_model) 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
```

{% hint style="info" %}
In 1.21.3 referenced to `assets/<namespace>/models/item/<id>`
{% endhint %}

### 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`

```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`

{% hint style="info" %}
custom\_model\_data Component Tutotial [Here](/components-guide/introduction/components.md#custom_model_data)!
{% endhint %}

### More Items Examples

{% file src="/files/pFd7YsNGEHeyemnePB8b" %}
Bow Examples
{% endfile %}

{% file src="/files/ke287EB9KLOSd6n8DgUE" %}
Crossbow Examples
{% endfile %}

{% file src="/files/u1NT8ai7MVQS5CmTZfia" %}
Fishing Rod Examples
{% endfile %}

{% file src="/files/tHKRQpgddRgpTmppsYMs" %}
Shield Item Examples
{% endfile %}

{% file src="/files/7cbaBDFmw0QgW0vWd5Cy" %}
Trident Item Example (Only you can modify the item on hand using ResourcePack)
{% endfile %}

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

```json
{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:custom_model_data",
        "entries": [
            {
                "threshold": 1381,
                "model": {
                    "property": "select",
                    "type": "minecraft:display_context",
                    "cases": [
                        {
                            "when": [
                                "gui",
                                "fixed",
                                "ground",
                                "on_shelf"
                            ],
                            "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`

```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

```json
{
    "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"
        }
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guide.elitefantasy.net/resourcepack-guide/beginning/models/itemsmodels-and-custommodeldata.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
