Skip to main content

✅ 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​

FieldTypeRequiredDefaultDescription
typestringYes—minecraft:select
propertystringYes—Select property type (see below)
caseslistYes—List of {when, model} pairs
fallbackmodelNoemptyModel used when no case matches
transformationobjectNo—Display transform overlay (26.1+)

Each case:

FieldTypeDescription
whenstring / listValue(s) to match (case-sensitive)
modelmodelModel used when the property equals this value

Properties​

No extra fields​

PropertyReturnsPossible values
minecraft:charge_typeType of projectile in charged_projectilesnone, arrow, rocket
minecraft:context_dimensionDimension ID of the context entityAny dimension ID (e.g. minecraft:overworld)
minecraft:context_entity_typeEntity type holding the itemAny entity type ID
minecraft:display_contextWhere the item is being renderednone, thirdperson_lefthand, thirdperson_righthand, firstperson_lefthand, firstperson_righthand, head, gui, ground, fixed, on_shelf
minecraft:main_handPlayer's main handleft, right
minecraft:trim_materialmaterial field from minecraft:trimAny 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
FieldTypeDescription
block_state_propertystringBlock 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
FieldTypeDescription
componentstringNamespaced component ID

minecraft:custom_model_data​

Reads from the strings list in minecraft:custom_model_data component.

property: minecraft:custom_model_data
index: 0
FieldTypeDefaultDescription
indexint0Position 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
FieldTypeDefaultDescription
patternstring—ICU date/time format pattern
localestring"" (root)Locale for formatting
time_zonestringclient TZTime zone ID