# Understanding the Item Model system

## What is this?

This is a feature added in 1.21.4 that allows you to create a lot of things using models, with conditions and other options available using the items section.

{% hint style="info" %}
To fully update the examples and possibilities, [check here!](https://minecraft.wiki/w/Items_model_definition)
{% endhint %}

```
📦resource_pack.zip
  └── 📁assets
       └── 📁minecraft
           └── 📁items
                ├── 📑diamond.json
                ├── 📑bow.json
                ├── 📑crossbow.json
                ├── 📑shield.json
                ├── 📑fishing_rod.json
                ├── 📑potion.json
                └── 📑<more_items>.json
```

{% hint style="info" %}
`hand_animation_on_swap` Optional. Describing if down-and-up animation should be played in first-person view when item slot is changed (either type, count, components or by swapping the item into the other hand). Default: `true`\ <br>

`oversized_in_gui` Optional. Describes if the items model is allowed to render bigger than the item slot. If `false` the render will be clipped to the item slot size. \
Default: `false`.

`swap_animation_scale` Optional. Indicates how fast the item moves up and down when swapping items in hotbar. Large speeds can allow items that take more of the screen space to fully duck before swapped into the next item. \
Default: `1.0`.
{% endhint %}

```json
{
    "hand_animation_on_swap": true,
    "oversized_in_gui": true,
    "swap_animation_scale": 1,
    "model": {
       //code
    }
}
```

## What are the types what that can be used with this?

These are all the types that you can use inside the model and we are going to see each one and its properties

| Parameter                       | Description                                                                                                            |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
| minecraft:model                 | Render a plain model from the `models` directory                                                                       |
| minecraft:composite             | Render multiple `sub-models` in the same space.                                                                        |
| minecraft:condition             | Renders a model if the condition is met                                                                                |
| minecraft:select                | Render an item model based on discrete property.                                                                       |
| minecraft:range\_dispatch       | Render an item model based on numeric property. Will select last entry with threshold less or equal to property value. |
| minecraft:empty                 | Does not render anything.                                                                                              |
| minecraft:bundle/selected\_item | Render the selected stack in `minecraft:bundle_contents` component, if present, otherwise does nothing.                |
| minecraft:special               | Render a special model.                                                                                                |

```json
📑Root model item model object
  ├── 📑type
  │    ├── 📑minecraft:model
  │    │    └── 📑model: <model>
  │    ├── 📑minecraft:composite
  │    │    └── 📑models:
  │    │         └── 📑<list_of_models>
  │    ├── 📑minecraft:condition
  │    │     └── 📑property
  │    │         ├── 📑minecraft:broken
  │    │         │    ├── 📑on_true
  │    │         │    │     └── <stuff>
  │    │         │    └── 📑on_false
  │    │         ├── 📑minecraft:bundle/has_selected_item
  │    │         ├── 📑minecraft:carried
  │    │         ├── 📑minecraft:component
  │    │         └── 📑<stuff>
  │    ├── 📑minecraft:select
  │    │    └── 📑property
  │    │         └── 📑<stuff>
  │    ├── 📑minecraft:range_dispatch
  │    ├── 📑minecraft:empty
  │    ├── 📑minecraft:bundle/selected_item
  │    └── 📑minecraft:special
  └──📑tints
      ├── 📑minecraft:constant
      ├── 📑minecraft:dye
      ├── 📑minecraft:firework
      ├── 📑minecraft:grass
      ├── 📑minecraft:map_color
      ├── 📑minecraft:potion
      ├── 📑minecraft:team
      └── 📑minecraft:custom_model_data
```

The available model types are quite curious, since you can put one type of model inside another type of model like this

```json
{
    "model": {
        "type": "minecraft:composite",
        "models": [
            {
                "type": "minecraft:condition",
                "property": "minecraft:keybind_down",
                "keybind": "key.right",
                "on_true": {
                    "type": "minecraft:select",
                    "property": "minecraft:local_time",
                    "locale": "",
                    "pattern": "HH",
                    "cases": [
                        {
                            "when": "12",
                            "model": {
                                "model": "minecraft:item/key_left_12_hour_diamond",
                                "type": "minecraft:model"
                            }
                        }
                    ],
                    "fallback": {
                        "type": "minecraft:model",
                        "model": "minecraft:item/diamond"
                    }
                },
                "on_false": {
                    "type": "minecraft:model",
                    "model": "minecraft:item/diamond"
                }
            }
        ]
    }
}
```

### `minecraft:model` Type Example

```json
{
    "model": {
        "type": "minecraft:model",
        "model": "minecraft:item/potion"
    }
}
```

### `minecraft:composite` Type Example

```json
{
    "model": {
        "type": "minecraft:composite",
        "models": [
            {
                "type": "minecraft:model",
                "model": "minecraft:item/custom/model_1"
            },
            {
                "type": "minecraft:model",
                "model": "minecraft:item/custom/model_2"
            },
            {
                "type": "minecraft:model",
                "model": "minecraft:item/custom/model_3"
            }
        ]
    }
}
```

### `minecraft:condition` Type Example

Property Types

| Parameter                            | Description                                                                                                                                                                                                                                                                                                                             |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| minecraft:broken                     | Return `true` if the item is damageable and has only one use remaining before breaking.                                                                                                                                                                                                                                                 |
| minecraft:bundle/has\_selected\_item | Return `true` if bundle is "open", i.e. it has selected item visible in GUI.                                                                                                                                                                                                                                                            |
| minecraft:carried                    | Return `true` if item is carried between slots in GUI.                                                                                                                                                                                                                                                                                  |
| minecraft:component                  | Uses component item sub predicates to match item components.                                                                                                                                                                                                                                                                            |
| minecraft:damaged                    | Return `true` if the item is damageable and has been used at least once.                                                                                                                                                                                                                                                                |
| minecraft:extended\_view             | Return `true` if player has requested extended details by holding shift key down. Only works when item is displayed in UI. Note: not a keybind, can't be rebound.                                                                                                                                                                       |
| minecraft:fishing\_rod/cast          | Return `true` if there is a fishing bobber attached to currently used fishing rod.                                                                                                                                                                                                                                                      |
| minecraft:has\_component             | Return `true` if the given component is present on the item.                                                                                                                                                                                                                                                                            |
| minecraft:keybind\_down              | Return `true` if keybind is currently active.                                                                                                                                                                                                                                                                                           |
| minecraft:selected                   | Return `true` if item is selected on a hotbar.                                                                                                                                                                                                                                                                                          |
| minecraft:using\_item                | Return `true` if player is currently using this item.                                                                                                                                                                                                                                                                                   |
| minecraft:view\_entity               | <p></p><ul><li>When not spectating, return <code>true</code> if context entity is the local player entity, i.e. the one controlled by client.</li><li>When spectating, return <code>true</code> if context entity is the <em>spectated</em> entity.</li><li>If context entity is not present, will return <code>false</code>.</li></ul> |
| minecraft:custom\_model\_data        | Return value from `flags` list in `minecraft:custom_model_data` component.                                                                                                                                                                                                                                                              |

Additional fiels depending on value of boolean property type

| Parameter | Description                                        |
| --------- | -------------------------------------------------- |
| on\_true  | The Item model object when the property is `true`. |
| on\_false | The Item model object when the property is `false` |

#### `minecraft:component` Condition Example

{% hint style="warning" %}
Only Available for +1.21.5
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:condition",
        "property": "minecraft:component",
        "component": "minecraft:custom_name",
        "cases": [
            {
                "when": "This is a Test",
                "model": {
                    "model": "minecraft:item/awesome_item",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond"
        }
    }
}
```

#### `minecraft:has_component` Condition Example

```json
{
    "model": {
        "type": "minecraft:condition",
        "property": "minecraft:has_component",
        "component": "minecraft:enchantments",
        "ignore_default": true,
        "on_false": {
            "type": "minecraft:model",
            "model": "minecraft:item/golden_hoe"
        },
        "on_true": {
            "type": "minecraft:model",
            "model": "minecraft:item/enchanted_golden_hoe"
        },
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/golden_hoe"
        }
    }
}
```

#### `minecraft:keybind_down` Condition Example

keybind options

| Parameter                   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Default activation key    |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------- |
| key.jump                    | Jump. When swimming, keeps the player afloat. When double-tapped, toggles Fly Mode (Creative only). When Fly Mode is on                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | <kbd>Space</kbd>          |
| key.sneak                   | Holding <kbd>Shift</kbd> and pressing use                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Left <kbd>Shift</kbd>     |
| key.sprint                  | Start sprinting. Increase speed when Fly Mode is on.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | Left <kbd>Control</kbd>   |
| key.left                    | Strafe left.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | <kbd>A</kbd>              |
| key.right                   | Strafe right.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | <kbd>D</kbd>              |
| key.back                    | Move backward.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | <kbd>S</kbd>              |
| key.forward                 | Move forward. The secondary sprint is permanently tied to this.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | <kbd>W</kbd>              |
| key.attack                  | Destroy blocks (hold down); Attack entity (click once).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |                           |
| key.pickItem                | Pressing that button while looking at a block or an entity makes the game attempt to put a corresponding item for the block or entity in the player's hand                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |                           |
| key.use                     | Place blocks, summon entities with spawn eggs, toggle levers/doors (click once), charge a bow (release to fire), crossbow, use crossbow, block using a shield, use special blocks like chests, doors, and levers, enter vehicles, eat food, drink potions, till farmland, shear or dye a sheep, command tamed wolves and cats to sit, trade with villagers, place fire using flint and steel or a fire charge, name a mob with a name tag, attach a lead to an animal or attach an animal on a lead to a fence, cast or reel in a fishing rod, throw a splash potion, egg, ender pearl, eye of ender, bottle o' enchanting, or snowball, equip armor from the hotbar if the associated armor slot is empty, eating cake, starting a furnace minecart, open book and quill and written book, use debug stick, add mob in a monster spawner. |                           |
| key.drop                    | Drop/toss an item                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | <kbd>Q</kbd>              |
| key.hotbar.1 – key.hotbar.9 | Selects the appropriate hotbar item. When in the inventory GUI, swap the contents of the inventory slot under the mouse pointer and the corresponding hotbar slot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | <kbd>1</kbd>–<kbd>9</kbd> |
| key.inventory               | Opens the inventory. Close any open GUI.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | <kbd>E</kbd>              |
| key.swapOffhand             | Switches the items in the players main and off-hand. When in the inventory GUI, swap the contents of the inventory slot under the mouse pointer and the off-hand slot.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | <kbd>F</kbd>              |
| key.loadToolbarActivator    | Press this key + any number, to access any of the 9 saved toolbars.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | <kbd>X</kbd>              |
| key.saveToolbarActivator    | Press this key + any number, to save the current toolbar under that number.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | <kbd>C</kbd>              |
| key.playerlist              | <p>In Multiplayer, hold the <kbd>Tab</kbd> key to see a list of players.</p><p>When in the chat window, <kbd>Tab</kbd> cycles through possible commands or arguments and also complete player names</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | <kbd>Tab</kbd>            |
| key.chat                    | Chat and server commands. If pressed while the Creative mode inventory is open, it switches to the Search tab.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | <kbd>T</kbd>              |
| key.command                 | Opens the chat window with the "/" character already typed. On some keyboards (Nordic layout at least) this button might be asterisk/apostrophe (\*/ ' ).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | <kbd>/</kbd>              |
| key.socialInteractions      | Gives players the ability to disable chatting with certain players, thus hiding any messages receiving from them. Whether a player is hidden resets when re-joining a server.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | <kbd>P</kbd>              |
| key.advancements            | Open the advancements screen.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | <kbd>L</kbd>              |
| key.spectatorOutlines       | Highlights players in Spectator mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Not bound                 |
| key.screenshot              | Simply pressing this key takes a screenshot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | <kbd>F2</kbd>             |
| key.smoothCamera            | Toggles mouse smoothing. Looking around becomes a slow, smooth and more cinematic motion.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Not bound                 |
| key.fullscreen              | Toggles full-screen mode.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | <kbd>F11</kbd>            |
| key.togglePerspective       | Toggles between first person, third person from the back and third person from the front.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | <kbd>F5</kbd>             |
|                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |                           |

Visual Example

<figure><img src="/files/hEXZXtcNq1kYUEqlW9Ui" alt=""><figcaption></figcaption></figure>

```json
{
    "model": {
        "type": "minecraft:composite",
        "models": [
            {
                "type": "minecraft:model",
                "model": "keyboard:item/keyboard/board"
            },
            {
                "type": "minecraft:condition",
                "property": "minecraft:keybind_down",
                "keybind": "key.right",
                "on_true": {
                    "type": "minecraft:model",
                    "model": "keyboard:item/keyboard/pressed_key/d"
                },
                "on_false": {
                    "type": "minecraft:model",
                    "model": "keyboard:item/keyboard/default_key/d"
                }
            }
        ]
    }
}
```

#### `minecraft:using_item` Condition Example

```json
{
    "model": {
        "type": "minecraft:condition",
        "on_false": {
            "type": "minecraft:model",
            "model": "minecraft:item/shield"
        },
        "on_true": {
            "type": "minecraft:special",
            "model": "minecraft:item/shield_blocking"
        },
        "property": "minecraft:using_item"
    }
}
```

#### `minecraft:custom_model_data` Condition Example

{% hint style="warning" %}
`index` Optional. Index for field in `flags`. Default: `0`.
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:condition",
        "on_false": {
            "type": "minecraft:model",
            "index": 0,
            "model": "minecraft:item/shield"
        },
        "on_true": {
            "type": "minecraft:model",
            "index": 0,
            "model": "minecraft:item/shield"
        },
        "property": "minecraft:custom_model_data"
    }
}
```

### `minecraft:select` Type Example

| Parameter                       | Description                                                                                                                                                                                                                        |
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| minecraft:block\_state          | Return value for some property from `minecraft:block_state` component.                                                                                                                                                             |
| minecraft:charge\_type          | Return charge type stored in `minecraft:charged_projectiles` component.                                                                                                                                                            |
| minecraft:component             | Return value from a component. If the selected value comes from a registry and the current datapacks does not provide it, the entry will be silently ignored.                                                                      |
| minecraft:context\_dimension    | Return the ID of the dimension in context, if any.                                                                                                                                                                                 |
| minecraft:context\_entity\_type | Return the holding entity type, if present.                                                                                                                                                                                        |
| minecraft:display\_context      | Return context this item is rendered in.                                                                                                                                                                                           |
| minecraft:local\_time           | Returns the current time formatted according to a given pattern. The value is updated every second. For full format documentation for locale, time zone and pattern, see ICU (International Components for Unicode) documentation. |
| minecraft:main\_hand            | Return main hand of holding player.                                                                                                                                                                                                |
| minecraft:trim\_material        | Return value of `material` field from `minecraft:trim` component, if present.                                                                                                                                                      |
| minecraft:custom\_model\_data   | Return value from `strings` list in `minecraft:custom_model_data` component.                                                                                                                                                       |

#### `minecraft:charge_type` Select Example

This will cause you to have a different model depending on the type of charge you gave it.

{% hint style="info" %}
Values:

* `none`: If there are no projectiles or component is not present.
* `rocket`: If there is at least one firework rocket.
* `arrow`: Any other case.
  {% endhint %}

```json
{
    "model": {
        "type": "minecraft:select",
        "property": "minecraft:charge_type",
        "cases": [
            {
                "when": "arrow",
                "model": {
                    "model": "minecraft:item/charded_arror_model",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/crossbow"
        }
    }
}
```

#### `minecraft:component` Values Example

```json
{
    "model": {
        "type": "minecraft:select",
        "property": "minecraft:component",
        "component": "minecraft:custom_name",
        "cases": [
            {
                "when": "Netherite Sword",
                "model": {
                    "model": "minecraft:item/netherite_sword",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond_sword"
        }
    }
}
```

#### `minecraft:context_dimension` Values Example

This will mean that when you are in a different dimension the object will have a different model.

{% hint style="info" %}
Values:

* Namespaced dimension ID.
  {% endhint %}

```json
{
    "model": {
        "type": "minecraft:select",
        "property": "minecraft:context_dimension",
        "cases": [
            {
                "when": "minecraft:the_end",
                "model": {
                    "model": "minecraft:item/corrupted_diamond_sword",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond_sword"
        }
    }
}
```

#### `minecraft:context_entity_type` Values Example

This may cause that when that specific entity holds the object in its hand it appears differently.

{% hint style="info" %}
Values:

* Namespaced entity type ID.
  {% endhint %}

```json
{
    "model": {
        "type": "minecraft:select",
        "property": "minecraft:context_entity_type",
        "cases": [
            {
                "when": "minecraft:zombie",
                "model": {
                    "model": "minecraft:item/destroyed_diamond_sword",
                    "type": "minecraft:model"
                }
            },
            {
                "when": [
                    "minecraft:baby_drowned",
                    "minecraft:drowned"
                ],
                "model": {
                    "model": "minecraft:item/oceanic_destroyed_diamond_sword",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond_sword"
        }
    }
}
```

#### `minecraft:display_context` Values Example

<figure><img src="/files/5YBgDFYLD4SCddc4N8t9" alt=""><figcaption></figcaption></figure>

This allows the model to change depending on what perspective is being viewed.

{% hint style="info" %}
Values:

* `none`
* `thirdperson_lefthand`
* `thirdperson_righthand`
* `firstperson_lefthand`
* `firstperson_righthand`
* `head`
* `gui`
* `ground`
* `fixed`
  {% endhint %}

```json
{
    "model": {
        "type": "minecraft:select",
        "property": "minecraft:display_context",
        "cases": [
            {
                "when": [
                    "gui",
                    "ground"
                ],
                "model": {
                    "model": "minecraft:item/epic_sword_item",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/epic_sword"
        }
    }
}
```

#### `minecraft:local_time`  Example

This allows the model to change depending on a schedule in real life

| Parameter  | Description                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| locale     | <p></p><p>Optional. Value describing locale. Default <code>""</code> which means "root" locale (a set of defaults, including English names).</p><ul><li><code>en\_US</code>: English language (used for things like week names), formating as in USA.</li><li><code>cs\_AU\@numbers=thai;calendar=japanese</code>: Czech language, Australian formatting, Thai numerals and Japanese calendar.</li></ul> |
| time\_zone | <p></p><p>Optional. Value describing time zone. If not present, defaults to timezone set on client.</p><ul><li>Examples: <code>Europe/Stockholm</code>, <code>GMT+0:45</code></li></ul>                                                                                                                                                                                                                  |
| pattern    | <p>Describes format to be used for time formatting<br></p><ul><li><code>yyyy-MM-dd</code>: 4-digit year number, then 2-digit month number, then 2-digit day of month number, all zero-padded if needed, separated by <code>-</code>.</li><li><code>HH:mm:ss</code>: current time (hours, minutes, seconds), 24-hour cycle, all zero-padded to 2 digits of needed, separated by <code>:</code></li></ul>  |

```json
{
    "model": {
        "type": "minecraft:select",
        "property": "minecraft:local_time",
        "locale": "",
        "pattern": "HH",
        "cases": [
            {
                "when": "12",
                "model": {
                    "model": "irlclock:item/clock/hour_12",
                    "type": "minecraft:model"
                }
            }
        ],
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/clock"
        }
    }
}
```

#### another example with chest christmas texture

```json
{
  "model": {
    "type": "minecraft:select",
    "cases": [
      {
        "model": {
          "type": "minecraft:special",
          "base": "minecraft:item/chest",
          "model": {
            "type": "minecraft:chest",
            "texture": "minecraft:christmas"
          }
        },
        "when": [
          "12-24",
          "12-25",
          "12-26"
        ]
      }
    ],
    "fallback": {
      "type": "minecraft:special",
      "base": "minecraft:item/chest",
      "model": {
        "type": "minecraft:chest",
        "texture": "minecraft:normal"
      }
    },
    "pattern": "MM-dd",
    "property": "minecraft:local_time"
  }
}
```

#### `minecraft:main_hand` Values Example

{% hint style="info" %}
Values:

* `left` or `right`
  {% endhint %}

#### `minecraft:trim_material` Values Example

{% hint style="info" %}
Values:

* Namespaced ID trim material.
  {% endhint %}

#### `minecraft:custom_model_data` Values Example

{% hint style="info" %}
Values:

* `Index` (Optional) for field in `strings`. Default: `0`
* Any String
  {% endhint %}

### `minecraft:range_dispatch` Type Example

| Parameter                     | Description                                                                                                                                                                                                          |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| miminecraft:bundle/fullness   | Return weight of `minecraft:bundle_contents` component or `0` if not present.                                                                                                                                        |
| minecraft:compass             | Return an angle, scaled from `0.0` to `1.0` in x-z plane between holder position and target. If target is not valid (not present, in other dimension or too close to holder position) random value will be returned. |
| mineminecraft:cooldown        | Return remaining cooldown for item, scaled between `0.0` to `1.0`.                                                                                                                                                   |
| minecraft:count               | Return stack size.                                                                                                                                                                                                   |
| minecraft:crossbow/pull       | Return crossbow-specific use time.                                                                                                                                                                                   |
| minecraft:damage              | Return value for `minecraft:damage` component or `0` if not present.                                                                                                                                                 |
| minecraft:time                | Return value of a in-game time, scaled betewen `0.0` to `1.0`                                                                                                                                                        |
| minecraft:use\_cycle          | Return remaining use ticks modulo `period`                                                                                                                                                                           |
| minecraft:use\_duration       | Return item use ticks.                                                                                                                                                                                               |
| minecraft:custom\_model\_data | Return value from `floats` list in `minecraft:custom_model_data` component or `0` if not present.                                                                                                                    |

#### `minecraft:compass` Range Dispatch Example

where this compass will direct you to

| Target Parameter | Description                                                           |
| ---------------- | --------------------------------------------------------------------- |
| spawn            | points at world spawn.                                                |
| lodestone        | points at location stored in `minecraft:lodestone_tracker` component. |
| recovery         | points at last player death location.                                 |
| none             | always return an invalid target.                                      |

{% hint style="info" %}
Wobble Value

Optional. If `true`, value will oscillate for some time around target before settling. Default: `true`
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:compass",
        "wobble": true,
        "target": "spawn",
        "cases": [
            {
                "when": "0.2",
                "model": {
                    "model": "irlclock:item/clock/compass_02",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond"
        }
    }
}
```

#### `minecraft:count` Range Dispatch Example

| Normalize Parameter | Description                                                                                 |
| ------------------- | ------------------------------------------------------------------------------------------- |
| true                | return count divided by `minecraft:max_stack_size` component, clamped to `0.0` to `1.0`     |
| false               | points at location stored in `min`return count clamped to `0` to `minecraft:max_stack_size` |

```json
{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:count",
        "cases": [
            {
                "when": "0.2",
                "model": {
                    "model": "minecraft:item/damaged_1",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond"
        }
    }
}
```

#### `minecraft:damage` Range Dispatch Example

| Parameter | Description                                                                                     |
| --------- | ----------------------------------------------------------------------------------------------- |
| true      | Tireturn value of damage divided by `minecraft:max_damage` component, clamped to `0.0` to `1.0` |
| false     | return raw value of damage, clamped to `0` to `minecraft:max_damage`                            |

#### `minecraft:time` Range Dispatch Example

| Parameter | Description                                                                                            |
| --------- | ------------------------------------------------------------------------------------------------------ |
| source    | Time source to return. One of `daytime`, `moon_phase` or `random`                                      |
| wobble    | Optional. If `true`, value will oscillate for some time around target before settling. Default: `true` |

```json
{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:time",
        "wobble": true,
        "source": "daytime",
        "entries": [
            {
                "threshold": 12000,
                "model": {
                    "model": "minecraft:item/awesome_time",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/compass"
        }
    }
}
```

#### `minecraft:use_duration` Range Dispatch Example

| Remaining Parameter | Description                                |
| ------------------- | ------------------------------------------ |
| true                | returned value will be remaining use ticks |
| false               | ticks so far                               |

```json
{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:use_duration",
        "remaining": false,
        "entries": [
            {
                "threshold": 0.58,
                "model": {
                    "model": "minecraft:item/awesome_item",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond"
        }
    }
}
```

#### `minecraft:custom_model_data` Range Dispatch Example

{% hint style="info" %}
`Index` (Optional) for field in `colors`. Default: `0`
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:custom_model_data",
        "index": 0,
        "entries": [
            {
                "threshold": 1382.0,
                "model": {
                    "model": "minecraft:item/awesome_item",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond"
        }
    }
}
```

### `minecraft:empty` Type Example

Does not render anything.

### `minecraft:bundle/selected_item` Type Example

Render the selected stack in `minecraft:bundle_contents` component, if present, otherwise does nothing.

### `minecraft:special` Type Example

| Parameter                | Description                                                                                                                |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------- |
| minecraft:banner         | Render a banner with patterns from `minecraft:banner_patterns` component.                                                  |
| minecraft:bed            | Render a whole bed.                                                                                                        |
| minecraft:chest          | Render a single chest.                                                                                                     |
| minecraft:conduit        | Render conduit.                                                                                                            |
| minecraft:decorated\_pot | Render a decorated pot. Uses values from `minecraft:pot_decorations` component.                                            |
| minecraft:head           | Render a head. Uses profile from `minecraft:profile` component when applicable.                                            |
| minecraft:shield         | Render a shield. Uses patterns from `minecraft:banner_patterns` component and color from `minecraft:base_color` component. |
| minecraft:shulker\_box   | Render a shulker box.                                                                                                      |
| minecraft:standing\_sign | Renders a standing sign.                                                                                                   |
| minecraft:hanging\_sign  | Renders a hanging sign.                                                                                                    |
| minecraft:trident        | Render a trident.                                                                                                          |

#### `minecraft:banner` Special Example

{% hint style="info" %}
`color` Color of the banner base, one of 16 predefined colors.
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:special",
        "property": "minecraft:banner",
        "base": "minecraft:item/template_banner",
        "model": {
            "type": "minecraft:banner",
            "color": "green"
        }
    }
}
```

#### `minecraft:bed` Special Example

{% hint style="info" %}
`texture` Namespaced ID for the texture, without `textures/entity/bed/` prefix and `.png` suffix
{% endhint %}

```json
{
  "model": {
    "type": "minecraft:special",
    "base": "minecraft:item/black_bed",
    "model": {
      "type": "minecraft:bed",
      "texture": "minecraft:black"
    }
  }
}
```

#### `minecraft:chest` Special Example

{% hint style="info" %}
`texture` Namespaced ID for the texture, without `textures/entity/chest/` prefix and `.png` suffix

`openness` Optional. Render the chest in the specified open state, between `0.0` (fully closed) to `1.0` (fully open). Default: `0.0`
{% endhint %}

```json
{
  "model": {
    "type": "minecraft:select",
    "cases": [
      {
        "model": {
          "type": "minecraft:special",
          "base": "minecraft:item/chest",
          "model": {
            "type": "minecraft:chest",
            "texture": "minecraft:christmas"
          }
        },
        "when": [
          "12-24",
          "12-25",
          "12-26"
        ]
      }
    ],
    "fallback": {
      "type": "minecraft:special",
      "base": "minecraft:item/chest",
      "model": {
        "type": "minecraft:chest",
        "openness": 0.0,
        "texture": "minecraft:normal"
      }
    },
    "pattern": "MM-dd",
    "property": "minecraft:local_time"
  }
}
```

#### `minecraft:head` Special Example

{% hint style="info" %}
`kind` One of `skeleton`, `wither_skeleton`, `player`, `zombie`, `creeper`, `piglin` or `dragon`

`texture` Optional. Namespaced ID for the texture, without `textures/entity/` prefix and `.png` suffix.

* If absent, default texture will be used, depending on `kind` field. Additionally, if present, `minecraft:profile` component is ignored.

`animation` Optional. Controlling head animation if available for this `kind` of head (like Piglin ears or Ender Dragon jaw). Default: `0.0`

* The `dragon` animation is `10` units long. Mouth fully closed at `-2.5` and fully open at `2.5`
* The `piglin` ears wiggle out of sync. The left ear period is `8.3333` and right ear period is `10.0`
  {% endhint %}

```json
{
  "model": {
    "type": "minecraft:special",
    "base": "minecraft:item/template_skull",
    "model": {
      "type": "minecraft:head",
      "animation": 0.0,
      "kind": "player"
    }
  }
}
```

#### `minecraft:shulker_box` Special Example

{% hint style="info" %}
`texture` Namespaced ID for the texture, without `textures/entity/shulker/` prefix and `.png` suffix

`openness` Optional. Render the shulker box in the specified open state, between `0.0` (fully closed) to `1.0` (fully open). Default: `0.0`

`orientation` Optional. Orientation for rendering. Default: `up`
{% endhint %}

```json
{
  "model": {
    "type": "minecraft:special",
    "base": "minecraft:item/shulker_box",
    "model": {
      "type": "minecraft:shulker_box",
      "openness": 0.0,
      "orientation": "up",
      "texture": "minecraft:shulker"
    }
  }
}
```

#### `minecraft:standing_sign` Special Example

{% hint style="info" %}
`wood_type` One of `oak`, `spruce`, `birch`, `acacia`, `cherry`, `jungle`, `dark_oak`, `pale_oak`, `mangrove`, `bamboo`, `crimson` or `warped`.

`texture` Optional. Namespaced ID for the texture, without `textures/entity/` prefix and `.png` suffix. If present, `wood_type` field is ignored.
{% endhint %}

```json
{
  "model": {
    "type": "minecraft:special",
    "model": {
      "type": "minecraft:standing_sign",
      "wood_type": "oak",
      "texture": "minecraft:signs/oak"
    }
  }
}
```

#### `minecraft:hanging_sign` Special Example

{% hint style="info" %}
`wood_type` One of `oak`, `spruce`, `birch`, `acacia`, `cherry`, `jungle`, `dark_oak`, `pale_oak`, `mangrove`, `bamboo`, `crimson` or `warped`.

`texture` Optional. Namespaced ID for the texture, without `textures/entity/` prefix and `.png` suffix. If present, `wood_type` field is ignored.
{% endhint %}

```json
{
  "model": {
    "type": "minecraft:special",
    "model": {
      "type": "minecraft:hanging_sign",
      "wood_type": "oak",
      "texture": "minecraft:signs/oak"
    }
  }
}
```

### Tints types

| Parameter                     | Description                                                                                                          |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| minecraft:constant            | A packed integer RGB value (e.g. `-1`) or an array of decimal RGB values, each between 0.0 and 1.0 (e.g. `[1, 1, 1]` |
| minecraft:dye                 | \[int] An RGB value.                                                                                                 |
| minecraft:firework            | \[int] An RGB value.                                                                                                 |
| minecraft:grass               | Return grass color at specific climate parameters, based on `assets/minecraft/textures/colormap/grass.png`           |
| minecraft:map\_color          | \[int] An RGB value.                                                                                                 |
| minecraft:potion              | \[int] An RGB value.                                                                                                 |
| minecraft:team                | \[int] An RGB value.                                                                                                 |
| minecraft:custom\_model\_data | \[int] An RGB value.                                                                                                 |

{% hint style="success" %}
To convert RGB values to int use [this](https://argb-int-calculator.netlify.app/)
{% endhint %}

#### `minecraft:potion` Example

{% hint style="warning" %}
Return color from `minecraft:potion_contents` component

* if component is present:
  * *`custom_color`* value, if there is one present in component
  * `default color`, if effect list is empty
  * average of effect colors
* else, default color
  {% endhint %}

```json
{
  "model": {
    "type": "minecraft:model",
    "model": "minecraft:item/potion",
    "tints": [
      {
        "type": "minecraft:potion",
        "default": -13083194
      }
    ]
  }
}
```

#### `minecraft:grass` Example

{% hint style="warning" %}
`temperature` Positive float between `0.0` and `1.0`

`downfall` Positive float between `0.0` and `1.0`
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:model",
        "model": "minecraft:block/grass_block",
        "tints": [
            {
                "type": "minecraft:grass",
                "downfall": 1,
                "temperature": 0.5
            }
        ]
    }
}
```

#### `minecraft:team` Example

{% hint style="warning" %}
Returns the team color of context entity, if any. Else, when there is no context entity, entity is not in a team or team has no color, return default.
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:model",
        "model": "minecraft:item/potion",
        "tints": [
            {
                "type": "minecraft:team",
                "default": -13083194
            }
        ]
    }
}
```

#### `minecraft:custom_model_data` Example

{% hint style="warning" %}
Return value from `colors` list in `minecraft:custom_model_data` component.\
\
`Index` (Optional) for field in `colors`. Default: `0`
{% endhint %}

```json
{
    "model": {
        "type": "minecraft:model",
        "model": "minecraft:item/potion",
        "tints": [
            {
                "type": "minecraft:custom_model_data",
                "index": 0,
                "default": -13083194
            }
        ]
    }
}
```

### Different model with different durability

This will cause the item to have 120 damage to have a different model.

```json
{
    "model": {
        "type": "minecraft:range_dispatch",
        "property": "minecraft:damage",
        "cases": [
            {
                "when": "120",
                "model": {
                    "model": "minecraft:item/diamond_sword_damage_1",
                    "type": "minecraft:model"
                }
            },
             {
                "when": "121",
                "model": {
                    "model": "minecraft:item/diamond_sword_damage_1",
                    "type": "minecraft:model"
                }
            }
        ],
        "scale": 1,
        "fallback": {
            "type": "minecraft:model",
            "model": "minecraft:item/diamond_sword"
        }
    }
}
```


---

# 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/understanding-the-item-model-system.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.
