Understanding the system the new item 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.
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
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.
The available model types are quite curious, since you can put one type of model inside another type of model like this
minecraft:model
Type Example
minecraft:model
Type Exampleminecraft:composite
Type Example
minecraft:composite
Type Exampleminecraft:condition
Type Example
minecraft:condition
Type ExampleProperty Types
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
When not spectating, return
true
if context entity is the local player entity, i.e. the one controlled by client.When spectating, return
true
if context entity is the spectated entity.If context entity is not present, will return
false
.
minecraft:custom_model_data
Return value from flags
list in minecraft:custom_model_data
component.
Additional fiels depending on value of boolean property type
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
minecraft:component
Condition ExampleOnly Available for +1.21.5
minecraft:has_component
Condition Example
minecraft:has_component
Condition Exampleminecraft:keybind_down
Condition Example
minecraft:keybind_down
Condition Examplekeybind options
key.jump
Jump. When swimming, keeps the player afloat. When double-tapped, toggles Fly Mode (Creative only). When Fly Mode is on
Space
key.sneak
Holding Shift and pressing use
Left Shift
key.sprint
Start sprinting. Increase speed when Fly Mode is on.
Left Control
key.left
Strafe left.
A
key.right
Strafe right.
D
key.back
Move backward.
S
key.forward
Move forward. The secondary sprint is permanently tied to this.
W
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
Q
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.
1–9
key.inventory
Opens the inventory. Close any open GUI.
E
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.
F
key.loadToolbarActivator
Press this key + any number, to access any of the 9 saved toolbars.
X
key.saveToolbarActivator
Press this key + any number, to save the current toolbar under that number.
C
key.playerlist
In Multiplayer, hold the Tab key to see a list of players.
When in the chat window, Tab cycles through possible commands or arguments and also complete player names
Tab
key.chat
Chat and server commands. If pressed while the Creative mode inventory is open, it switches to the Search tab.
T
key.command
Opens the chat window with the "/" character already typed. On some keyboards (Nordic layout at least) this button might be asterisk/apostrophe (*/ ' ).
/
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.
P
key.advancements
Open the advancements screen.
L
key.spectatorOutlines
Highlights players in Spectator mode.
Not bound
key.screenshot
Simply pressing this key takes a screenshot
F2
key.smoothCamera
Toggles mouse smoothing. Looking around becomes a slow, smooth and more cinematic motion.
Not bound
key.fullscreen
Toggles full-screen mode.
F11
key.togglePerspective
Toggles between first person, third person from the back and third person from the front.
F5
Visual Example
minecraft:using_item
Condition Example
minecraft:using_item
Condition Exampleminecraft:custom_model_data
Condition Example
minecraft:custom_model_data
Condition Exampleindex
Optional. Index for field in flags
. Default: 0
.
minecraft:select
Type Example
minecraft:select
Type Exampleminecraft: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
minecraft:charge_type
Select ExampleThis will cause you to have a different model depending on the type of charge you gave it.
minecraft:component
Values Example
minecraft:component
Values Exampleminecraft:context_dimension
Values Example
minecraft:context_dimension
Values ExampleThis will mean that when you are in a different dimension the object will have a different model.
minecraft:context_entity_type
Values Example
minecraft:context_entity_type
Values ExampleThis may cause that when that specific entity holds the object in its hand it appears differently.
minecraft:display_context
Values Example
minecraft:display_context
Values ExampleThis allows the model to change depending on what perspective is being viewed.
minecraft:local_time
Example
minecraft:local_time
ExampleThis allows the model to change depending on a schedule in real life
locale
Optional. Value describing locale. Default ""
which means "root" locale (a set of defaults, including English names).
en_US
: English language (used for things like week names), formating as in USA.cs_AU@numbers=thai;calendar=japanese
: Czech language, Australian formatting, Thai numerals and Japanese calendar.
time_zone
Optional. Value describing time zone. If not present, defaults to timezone set on client.
Examples:
Europe/Stockholm
,GMT+0:45
pattern
Describes format to be used for time formatting
yyyy-MM-dd
: 4-digit year number, then 2-digit month number, then 2-digit day of month number, all zero-padded if needed, separated by-
.HH:mm:ss
: current time (hours, minutes, seconds), 24-hour cycle, all zero-padded to 2 digits of needed, separated by:
another example with chest christmas texture
minecraft:main_hand
Values Example
minecraft:main_hand
Values Exampleminecraft:trim_material
Values Example
minecraft:trim_material
Values Exampleminecraft:custom_model_data
Values Example
minecraft:custom_model_data
Values Exampleminecraft:range_dispatch
Type Example
minecraft:range_dispatch
Type Examplemiminecraft: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
minecraft:compass
Range Dispatch Examplewhere this compass will direct you to
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.
minecraft:count
Range Dispatch Example
minecraft:count
Range Dispatch Exampletrue
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
minecraft:damage
Range Dispatch Example
minecraft:damage
Range Dispatch Exampletrue
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
minecraft:time
Range Dispatch Examplesource
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
minecraft:use_duration
Range Dispatch Example
minecraft:use_duration
Range Dispatch Exampletrue
returned value will be remaining use ticks
false
ticks so far
minecraft:custom_model_data
Range Dispatch Example
minecraft:custom_model_data
Range Dispatch Exampleminecraft:empty
Type Example
minecraft:empty
Type ExampleDoes not render anything.
minecraft:bundle/selected_item
Type Example
minecraft:bundle/selected_item
Type ExampleRender the selected stack in minecraft:bundle_contents
component, if present, otherwise does nothing.
minecraft:special
Type Example
minecraft:special
Type Exampleminecraft: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
minecraft:banner
Special Exampleminecraft:bed
Special Example
minecraft:bed
Special Exampleminecraft:chest
Special Example
minecraft:chest
Special Exampleminecraft:head
Special Example
minecraft:head
Special Exampleminecraft:shulker_box
Special Example
minecraft:shulker_box
Special Exampleminecraft:standing_sign
Special Example
minecraft:standing_sign
Special Exampleminecraft:hanging_sign
Special Example
minecraft:hanging_sign
Special ExampleTints types
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.
minecraft:potion
Example
minecraft:potion
ExampleReturn color from minecraft:potion_contents
component
if component is present:
custom_color
value, if there is one present in componentdefault color
, if effect list is emptyaverage of effect colors
else, default color
minecraft:grass
Example
minecraft:grass
Exampletemperature
Positive float between 0.0
and 1.0
downfall
Positive float between 0.0
and 1.0
minecraft:team
Example
minecraft:team
ExampleReturns 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.
minecraft:custom_model_data
Example
minecraft:custom_model_data
ExampleReturn value from colors
list in minecraft:custom_model_data
component.
Index
(Optional) for field in colors
. Default: 0
Different model with different durability
This will cause the item to have 120 damage to have a different model.
Last updated