â Select
Overviewâ
Chooses a child model by matching a discrete (string/enum) property against a list of cases. If no case matches, the fallback is used; if no fallback is provided, renders as empty.
items:
demo:crossbow:
material: crossbow
model:
type: minecraft:select
property: minecraft:charge_type
cases:
- when: arrow
model:
type: minecraft:model
path: minecraft:item/custom/crossbow_arrow
- when: rocket
model:
type: minecraft:model
path: minecraft:item/custom/crossbow_firework
fallback:
type: minecraft:model
path: minecraft:item/custom/crossbow_standby
Fieldsâ
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | Yes | â | minecraft:select |
property | string | Yes | â | Select property type (see below) |
cases | list | Yes | â | List of {when, model} pairs |
fallback | model | No | empty | Model used when no case matches |
transformation | object | No | â | Display transform overlay (26.1+) |
Each case:
| Field | Type | Description |
|---|---|---|
when | string / list | Value(s) to match (case-sensitive) |
model | model | Model used when the property equals this value |
Propertiesâ
No extra fieldsâ
| Property | Returns | Possible values |
|---|---|---|
minecraft:charge_type | Type of projectile in charged_projectiles | none, arrow, rocket |
minecraft:context_dimension | Dimension ID of the context entity | Any dimension ID (e.g. minecraft:overworld) |
minecraft:context_entity_type | Entity type holding the item | Any entity type ID |
minecraft:display_context | Where the item is being rendered | none, thirdperson_lefthand, thirdperson_righthand, firstperson_lefthand, firstperson_righthand, head, gui, ground, fixed, on_shelf |
minecraft:main_hand | Player's main hand | left, right |
minecraft:trim_material | material field from minecraft:trim | Any trim material ID |
minecraft:block_stateâ
Reads a property from minecraft:block_state component.
property: minecraft:block_state
block_state_property: facing # Block state key to read
| Field | Type | Description |
|---|---|---|
block_state_property | string | Block state property key |
minecraft:component (1.21.5+)â
Returns the value of a component from the item stack. Values from a registry that the current datapack doesn't provide are silently ignored.
property: minecraft:component
component: minecraft:unbreakable
| Field | Type | Description |
|---|---|---|
component | string | Namespaced component ID |
minecraft:custom_model_dataâ
Reads from the strings list in minecraft:custom_model_data component.
property: minecraft:custom_model_data
index: 0
| Field | Type | Default | Description |
|---|---|---|---|
index | int | 0 | Position in the strings array |
minecraft:local_timeâ
Returns the current time formatted by an ICU pattern. Updated every second.
property: minecraft:local_time
pattern: "HH:mm:ss"
locale: "en_US" # Default: system locale
time_zone: "GMT+8:00" # Default: client timezone
| Field | Type | Default | Description |
|---|---|---|---|
pattern | string | â | ICU date/time format pattern |
locale | string | "" (root) | Locale for formatting |
time_zone | string | client TZ | Time zone ID |