Minecraft:Data component format: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{About|the format in {{JE}}|the legacy format|Item format/Before 1.20.5|the format in {{BE}}|Item components}} | {{About|the format in {{JE}}|the legacy format|Item format/Before 1.20.5|the format in {{BE}}|Item components}} | ||
{{ | {{for|other uses|Component}}{{exclusive|java}} | ||
'''Data components''', or simply '''components''', are structured data used to store information and define behavior. Their IDs are [[Minecraft:namespaced identifier]]s, and their values can be any data type – see {{slink||List of components}}. | '''Data components''', or simply '''components''', are structured data used to store information and define behavior. Their IDs are [[Minecraft:namespaced identifier]]s, and their values can be any data type – see {{slink||List of components}}. | ||
| Line 518: | Line 518: | ||
* {{nbt|compound|components}}: Parent tag. | * {{nbt|compound|components}}: Parent tag. | ||
{{/item name}} | {{/item name}} | ||
</div> | ''Example:'' {{command|1=give @s diamond[minecraft:item_name="Dirt"]}} | ||
* Gives a diamond that is named "Dirt".</div> | |||
=== jukebox_playable === | === jukebox_playable === | ||
Latest revision as of 11:05, 3 June 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Template:ForTemplate:Exclusive
Data components, or simply components, are structured data used to store information and define behavior. Their IDs are Minecraft:namespaced identifiers, and their values can be any data type – see Template:Slink.
When used by Minecraft:items, they are referred as item components or item stack components. They can exist anywhere that an item is stored, such as the player's inventory, container block entities, and Minecraft:structure files. Importantly, not all characteristics of items are covered by data components, and remain as fixed properties associated with the item ID; the behaviour cannot be removed from the item, nor applied to a different item that does not have that behaviour by default. For a reasonably comprehensive list of such properties associated with items in the latest version, see Minecraft:Java Edition hardcoded item properties.
Data components are only partly implemented for Minecraft:block entities. They partially replace the Minecraft:NBT format and allow some block data to be read or copied through predicates and loot functions.
Similarly, entities can interact with data components through predicates and loot functions, however they still strictly use the Minecraft:NBT format and other older internal systems to store their data in memory, not data components.
Usage
Command format
Data components can be used in the item_stack and item_predicate argument types.
In commands that take an item_stack argument, such as Template:Command, items are represented in the format item_id[component1=value,component2=value], with component being the Minecraft:namespaced ID of a component, and the value being the value of the component written in SNBT format. Components can be removed by prefixing them with an exclamation mark, like item_id[!component3]. Any components that are not specified are implicitly set to the component's default value for that item type. If no components are specified, the square brackets can be removed, leaving just the item ID. See item_stack for details.
In commands that take an item_predicate argument, such as Template:Command and Template:Command, item predicates are represented in the format item_type[list of tests], with each test either checking if a component exists with any value, checking for an exact component value match, or checking for a Minecraft:data component predicate. See item_predicate for details.
Item format
Every item type (item ID) has a set of default data components. Item stacks must specify an item ID, which implicitly sets these default components, but they may be overridden by that individual item stack. Default components are not saved on individual item stacks.
When saved in the Minecraft:NBT format, items are written as a compound with the following tags:
- Template:Nbt The root tag. <section begin="item format" /><section begin="item format nocount" />
- Template:Nbt: The Minecraft:resource location of the item. Must not be
minecraft:air.<section end="item format nocount" /> - Template:Nbt: Number of Minecraft:items stacked in this inventory slot. Any item can be stacked, even if unstackable through normal means. Defaults to 1 if not specified.<section begin="item format nocount" />
- Template:Nbt: Optional map of additional (non-default) data components.
- See the list of components below.<section end="item format nocount" /><section end="item format" />
- Template:Nbt: The Minecraft:resource location of the item. Must not be
In containers that do not use the data component format (such as container blocks and entity inventories), an additional Template:Nbt tag is used to specify the slot the item is in e.g. {Slot:0b,id:"stone"}. This is not a part of the item stack format so is not present anywhere else where individual items are stored (such as single-slot containers, unstructured lists of items, etc.). In the data component format, slot numbers and item stacks are stored as separate fields e.g. {slot:0,item:{id:"stone"}}.
Block entity format
Template:Main Block entities are stored in the Minecraft:NBT format. While they still use NBT tags for their individual properties, any non-default data components that exist on the item used to place the block will be saved.
Some NBT data on block entities are treated as data components when transferring data between items and blocks. For example, the Items field in a chest is interpreted as the minecraft:container component, despite being labeled and structured differently.
- Template:Nbt The root tag.
{{#lst:Block entity format|nbt format}}
- Additional tags depending on the block entity ID. See Minecraft:Block entity format.
For example, if a chest was given to a player with the components minecraft:custom_data={foo:1} and minecraft:container=[{slot:0,item:{id:"stone"}}]], then placed the block on the ground, the block will be saved (omitting some fields) as:
{id:"minecraft:chest", Items:[{count:1,id:"minecraft:stone",Slot:0b}], components:{"minecraft:custom_data":{foo:1}}}
with minecraft:container saved as the Items tag, and minecraft:custom_data separated as it is not used by chest block entities.
List of components
Template:DCLTemplate:Columns-list
attack_range
- Template:Nbt: Parent tag.
- Template:Nbt: Determines the Minecraft:attack range and Minecraft:hitbox margin of a weapon.
- Template:Nbt: The minimum distance in blocks from the attacker to the target to be considered valid. Defaults to 0.0, valid from 0.0 to 64.0.
- Template:Nbt: The maximum distance in blocks from the attacker to the target to be considered valid. Defaults to 3.0, valid from 0.0 to 64.0.
- Template:Nbt: The minimum distance in blocks from the attacker to the target to be considered valid in Minecraft:Creative mode. Defaults to 0.0, valid from 0.0 to 64.0.
- Template:Nbt: The maximum distance in blocks from the attacker to the target to be considered valid in Creative mode. Defaults to 5.0, valid from 0.0 to 64.0.
- Template:Nbt: The margin applied to the target bounding box when checking for valid hitbox collision. Defaults to 0.3, valid from 0.0 to 1.0.
- Template:Nbt: The multiplier applied to Template:Cd and Template:Cd when checking for valid distance if item is used by a mob. Defaults to 1.0, valid from 0.0 to 2.0.
- Template:Nbt: Determines the Minecraft:attack range and Minecraft:hitbox margin of a weapon.
Example: Template:Cmd
- Gives a diamond that has an attack range of 5 blocks.
attribute_modifiers
Example: Template:Command
- Gives a stick that causes the player to grow 4x when holding it.
banner_patterns
Example: Template:Command
- Gives a black banner with a red triangle and white cross pattern.
base_color
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a lime shield.
bees
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a bee nest containing a single bee named Maya, which exits the bee nest in 3 seconds.
block_entity_data
Example: Template:Command
- Gives a spider spawner. Placing this spawner requires the player to have operator permissions.
block_state
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a bamboo slab that is always placed in the top half of the block.
blocks_attacks
Example: Template:Command
- Gives a diamond sword that can block half of the damage from mob attacks, arrows, and explosions, cannot be disabled by a disabling attack, and plays the anvil place sound upon successful blocking.
break_sound
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a diamond sword that when runs out of durability, it plays the wolf armor break sound.
bucket_entity_data
Other tags such as the entity's name or variant are stored as separate item components such as Template:Cd and Template:Cd.
Example: Template:Command
- Gives a bucket of axolotl that has 3 health, the Wild type, and is named "Bob".
bundle_contents
Example: Template:Command
- Gives a bundle containing exactly 2 diamonds.
can_break
When present, the player holding the item can break the specified blocks in Minecraft:Adventure mode.
- Template:Nbt: Parent tag.
- Template:NbtTemplate:Nbt: The only blocks this item may break when used by a player in Minecraft:Adventure mode. If defined as a compound, corresponds to Template:Nbt A single block predicate. Items are listed in the tooltip in the order specified.
- Template:Nbt: A single block predicate.
- Template:NbtTemplate:Nbt: Can be a single block ID, a list of block IDs, or a block tag with a
#. The names of included blocks are displayed in the tooltip. - Template:Nbt: Minecraft:Block entity NBT to match. See Minecraft:Block entity format.
- Template:Nbt: The block state properties to match.
- Template:Nbt: A key-value pair, where the key is a block state key and the value is a block state value to match, for example
facing: "east".
- Template:Nbt: A key-value pair, where the key is a block state key and the value is a block state value to match, for example
- Template:NbtTemplate:Nbt: Can be a single block ID, a list of block IDs, or a block tag with a
- Template:Nbt: A single block predicate.
- Template:NbtTemplate:Nbt: The only blocks this item may break when used by a player in Minecraft:Adventure mode. If defined as a compound, corresponds to Template:Nbt A single block predicate. Items are listed in the tooltip in the order specified.
Example: Template:Command
- Gives a netherite pickaxe that can only mine some ores, as well as black concrete.
can_place_on
When present, the player holding the item can place the held block item on any sides of the specified blocks in Minecraft:Adventure mode.
- Template:Nbt: Parent tag.
- Template:NbtTemplate:Nbt: Determines which blocks that blocks with this component can be placed against in Minecraft:Adventure mode. If defined as a compound, corresponds to Template:Nbt A single block predicate. Items are listed in the tooltip in the order specified.
- Template:Nbt: A single block predicate.
- Template:NbtTemplate:Nbt: Can be a single block ID, a list of block IDs, or a block tag with a
#. The names of included blocks are displayed in the tooltip. - Template:Nbt: Minecraft:Block entity NBT to match. See Minecraft:Block entity format.
- Template:Nbt: The block state properties to match.
- Template:Nbt: A key-value pair, where the key is a block state key and the value is a block state value to match, for example
facing: "east".
- Template:Nbt: A key-value pair, where the key is a block state key and the value is a block state value to match, for example
- Template:NbtTemplate:Nbt: Can be a single block ID, a list of block IDs, or a block tag with a
- Template:Nbt: A single block predicate.
- Template:NbtTemplate:Nbt: Determines which blocks that blocks with this component can be placed against in Minecraft:Adventure mode. If defined as a compound, corresponds to Template:Nbt A single block predicate. Items are listed in the tooltip in the order specified.
Example: Template:Command
- Gives a target block that can only be placed on sandstone.
charged_projectiles
Example: Template:Command
- Gives a crossbow that is already charged with a spectral arrow.
Note: Adding an invalid projectile or item id charges an arrow that, when collected, grants the wrong item. Ex: wind_charge causes it to fire an arrow that grants a wind charge when collected.
consumable
Template:DCL If present, the item can be consumed. Its options can also be modified.
- If the item already has an existing right-click functionality (like placing a block), it keeps that functionality.
- If the Template:DCL, Template:DCL, Template:DCL or Template:DCL components are also present on this item, consuming it applies the stats and effects of those components.
- If the Template:DCL component are also present on this item, Minecraft:foxes consider the item as consumable food.
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a gold ingot that can be eaten in 3 seconds and upon consuming, clears all effects.
container
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a barrel with an apple in the first slot.
container_loot
Example: Template:Command
- Gives a chest that contains the desert pyramid loot when opened.
custom_data
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives an iron sword with custom data
{foo:1}.
custom_model_data
Example:
- Gives a bone with custom model data. The
colorslist shows three possible representations of the same violet color.
custom_name
Used to specify an item, block, or entity's custom name. This component can be added, changed, or removed by any player with the item who has access to an anvil.
- Template:Nbt: Parent tag.
- Template:NbtTemplate:NbtTemplate:Nbt minecraft:custom_name: The player-assigned name of this item, block, or entity, typically assigned with an Minecraft:anvil or a Minecraft:name tag. See Minecraft:Text component format.
- If present on an item, this component has highest priority to display as the item's name, and appears italic unless overridden by the text component format.
- If present on an entity, it will replace the entity's name tag, will show the name tag to players when they hover over the entity (unless invisible), and will appear as that entity's name in commands and chat messages.
- If present on a block with a GUI (such as a container), this replaces the name at the top of the GUI.
- If present on a Minecraft:command block, this replaces the execution context name when the command is ran.
Example:
- Gives a stick named "Magic Wand" in light purple non-italicized text.
damage
- Template:Nbt: Parent tag.
- Template:Nbt: The number of uses consumed (not remaining) of the item's Minecraft:durability. Must be a non-negative integer, defaults to 0. If not present, the item cannot take damage. If this component is present on an item, its value is non-zero, the Template:DCL is also present on the item, and the player hovering over the item has Minecraft:advanced tooltips on, then white text is added to the tooltip showing "Durability: Template:Cd / Template:Cd".
Example: Template:Command
- Gives a diamond axe with 500 points of damage.
damage_resistant
- Template:Nbt: Parent tag.
- Template:Nbt: If specified, this item is invulnerable to the specified damage types when in entity form or equipped.
- Template:Nbt: A damage type tag prefixed with Template:Cd.
- Template:Nbt: If specified, this item is invulnerable to the specified damage types when in entity form or equipped.
Example: Template:Command
- Gives a cake that is immune to all types of fire damage.
damage_type
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a diamond sword that deals "campfire" type damage.
death_protection
- Template:Nbt: Parent tag.
- Template:Nbt: If present, this item protects the holder from dying by restoring a single Minecraft:health point.
- Template:Nbt: A list of consume effects that are applied when the item protects the holder. Optional.
- Template:Nbt: A single consume effect.
- Template:Nbt: A list of consume effects that are applied when the item protects the holder. Optional.
- Template:Nbt: If present, this item protects the holder from dying by restoring a single Minecraft:health point.
Example: Template:Command
- Gives a nether star that protects the holder from death and removes all status effects from the holder.
debug_stick_state
Example: Template:Command
- Gives a debug stick with the Minecraft:oak fence block state property set to
westand the Minecraft:candle block state property set tolit.
dye
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a blue dye item that acts like a red dye.
dyed_color
- Template:Nbt: Parent tag.
- Template:Nbt: The RGB color of the tint applied to a dyed item, typically as a result of combining the item with dyes in a Template:Cd type crafting recipe. More generally, this component is used as the Template:Cd color provider in Minecraft:item model definitions (so only item models that explicitly use this color provider will be tinted). If present on an item, gray text is added to the tooltip showing either an italic "Dyed" when Minecraft:advanced tooltips is off, or a non-italic "Color: #Template:Cd"<ref group="note">The hexadecimal number is always at least 6 digits (with leading zeroes if needed), with additional digits if the alpha channel is included, despite the alpha channel having no effect on the tint color.</ref> instead when Minecraft:advanced tooltips is on. The color is stored as an integer which packs the color's red, green and blue channels using this formula:
(Template:Color << 16) + (Template:Color << 8) + Template:Color<ref group="note">For positive values larger than 0x00FFFFFF, the most significant byte encodes the alpha channel (opacity), however this is effectively ignored when providing the tint color to the item model, as the tint does not affect opacity.</ref> Template:Calculator - Template:Nbt: An alternative format. A list of 3 floats, ranging from 0.0 to 1.0 (inclusive)<ref group="note">Float values outside of this range are accepted, but clamped from 0 to 255 by modulo 256 after being multiplied by 255. For example, -1.0 is equivalent to 0.00392156862 (or 1/255).</ref>, corresponding to the red, green and blue channels of the color. This format is automatically packed into the integer format by multiplying each float by 255, converting them to unsigned bytes (equivalent to taking the floor and then applying modulo 256), then using the formula
-16777216 + (Template:Color << 16) + (Template:Color << 8) + Template:Colordue to the alpha channel being implicitly set to 255, resulting in a negative integer.<ref group="note">This can result in an item that is not normally obtainable and it affects the hexadecimal code that is shown in the (advanced) tooltip. For example Template:Cd shows "#000000" but Template:Cd shows "#FF000000" despite them both representing the same pure black RGB color.</ref>.
- Template:Nbt: The RGB color of the tint applied to a dyed item, typically as a result of combining the item with dyes in a Template:Cd type crafting recipe. More generally, this component is used as the Template:Cd color provider in Minecraft:item model definitions (so only item models that explicitly use this color provider will be tinted). If present on an item, gray text is added to the tooltip showing either an italic "Dyed" when Minecraft:advanced tooltips is off, or a non-italic "Color: #Template:Cd"<ref group="note">The hexadecimal number is always at least 6 digits (with leading zeroes if needed), with additional digits if the alpha channel is included, despite the alpha channel having no effect on the tint color.</ref> instead when Minecraft:advanced tooltips is on. The color is stored as an integer which packs the color's red, green and blue channels using this formula:
Example: Template:Command
or: Template:Command
or: Template:Command
- Gives a blueish-green leather helmet.
enchantable
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a pair of elytra that can be enchanted in an enchanting table with an enchantability of 15.
enchantment_glint_override
Example: Template:Command
- Gives an experience bottle without the visual enchantment glint, which is otherwise applied by default.
enchantments
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a wooden sword with sharpness III and knockback II.
Note: This component adds active enchantments and should not be confused with the Template:DCL component, which is used to add inactive enchantments, such as with enchanted books.
To illustrate the difference, hitting an entity with an Template:Cd would knock any entity hit per knockback II while hitting an entity with an Template:Cd would not.
Furthermore the latter would be able to add knockback II to an enchantable item in an anvil, while the former would not.
entity_data
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives an armor stand that is small when placed down.
equippable
- Template:Nbt: Parent tag.
- Template:Nbt: If present, this item can be equipped in the specified slot.
- Template:Nbt: The slot to put the item on. Can be one of Template:Cd
- Template:NbtTemplate:Nbt: Template:Json ref to play when the item is equipped. Defaults to
item.armor.equip_generic. - Template:Nbt: The Minecraft:resource location of the Minecraft:equipment model to use when equipped. The directory this refers to is
assets/<namespace>/equipment/<id>.json. If not specified, falls back to rendering as the item itself when in the head slot (if not applicable, the item does not render). - Template:NbtTemplate:Nbt: Entity ID, Entity Tag, or list of Entity IDs to limit which entities can equip this item. Defaults to all entities.
- Template:Nbt: Whether the item can be dispensed by using a Minecraft:dispenser.<ref group="note">If the item type has special dispenser behavior, this has no effect.</ref> Defaults to
true. - Template:Nbt: Whether the item can be equipped into the relevant slot by right-clicking. Defaults to
true. - Template:Nbt: Whether this item is damaged when the wearing entity is damaged. Defaults to
true. - Template:Nbt: Whether this item can be equipped onto a target mob by pressing Template:Control on it (as long as this item can be equipped on the target at all). Defaults to
false. - Template:Nbt: The Minecraft:resource location of the overlay texture to use when equipped. The directory this refers to is
assets/<namespace>/textures/<id>. Assets which do not exist will use the Minecraft:missing texture, rather than falling back to a default such as the pumpkin overlay. - Template:Nbt: Whether this item can be unequipped from a target mob by right-clicking with Shears. Defaults to
false. - Template:NbtTemplate:Nbt: Template:Json ref to play when the item is sheared. Defaults to
item.shears.snip.
- Template:Nbt: If present, this item can be equipped in the specified slot.
Example 1: Template:Command
- Gives a glass block that can be equipped in the helmet slot.
Example 2: Template:Command
- Gives a pair of leather pants that appear as diamond leggings when worn.
firework_explosion
fireworks
- Template:Nbt: Parent tag.
food
If present and the Template:DCL component are also present on this item, Minecraft:foxes consider the item as consumable food.
- Template:Nbt: Parent tag.
Example 1: Template:Command
- Gives a melon slice that can be eaten at any time and restores 3 food points and 1 saturation.
Example 2: Template:Command
- Gives a sponge that can be eaten at any time, takes 2.4 seconds to consume, and restores 5 food points and 5 saturation.
glider
- Template:Nbt: Parent tag.
- Template:Nbt: If present, this item allows living entities to glide (as with Minecraft:elytra) when equipped. If the item is damageable, it will only allow entities to glide if it has Template:DCL < Template:DCL − 1. Every second while an entity is gliding, the game will select a random equipped glider item that isn't too damaged to function and try to apply one point of durability damage.
Example: Template:Command
- Gives a nether star that can be equipped in the head slot, and if is placed on the head, it allows the player to glide.
instrument
- Template:Nbt: Parent tag.
- Template:NbtTemplate:Nbt: Template:Json ref. If present on an item, the description of the instrument is shown in the item's tooltip as gray text.
There are actually two unique states of this component that both register in usage as the
minecraft:ponder_goat_horninstrument ID, but they do not stack with each other, only one of them matches a component comparison for that ID, and only one of them gets serialised while the other does not.
- Template:NbtTemplate:Nbt: Template:Json ref. If present on an item, the description of the instrument is shown in the item's tooltip as gray text.
Example 1: Template:Command
- Gives a Minecraft:goat horn that uses the Feel instrument.
Example 2: Template:Command
- Gives a goat horn that plays the entity.creeper.primed sound.
intangible_projectile
Example: Template:Command
- Gives an arrow that cannot be picked up by players in Minecraft:Survival mode.
item_model
- Template:Nbt: Parent tag.
- Template:Nbt: The Minecraft:resource location of the item, which references the item model definition /assets/<namespace>/items/<id> without the .json suffix. Referencing nonexistent models will cause the Minecraft:missing model to be used, rather than falling back to the item ID's default model.
Example: Template:Command
- Gives a netherite sword that looks like a diamond sword.
item_name
- Template:Nbt: Parent tag.
- Template:NbtTemplate:NbtTemplate:Nbt: The default name of this item, as a Minecraft:text component, present on all items by default. Unlike the Template:DCL component, this name cannot be erased using an anvil, is not italicized, and does not appear in some labels, such as banner markers and item frames.
Example: Template:Command
- Gives a diamond that is named "Dirt".
jukebox_playable
Example: Template:Command
- Gives a diamond that plays Pigstep when inserted into a jukebox
kinetic_weapon
- Template:Nbt: Parent tag.
- Template:Nbt: Enables a charge-type attack when using the item where, while being used, the damage is dealt along a ray every tick based on the relative speed of the entities
- Template:Nbt: The time in ticks required before weapon is effective. Defaults to 0.
- Template:Nbt: The condition under which the charge attack deals damage.
- Template:Nbt: The condition under which the charge attack dismounts the target.
- Template:Nbt: The condition under which the charge attack deals knockback.
- Template:Nbt: The distance the item moves out of the wielder's hand during its animation. Defaults to 0.0.
- Template:Nbt: The multiplier for the final damage from the relative speed.<ref group="note">The damage dealt is calculated as
floor(relative_speed * damage_multiplier), whererelative_speedis the difference of speed vectors of the attacker and the target as projected onto the axis of the attacker's view vector. Any additional damage from enchantments or attribute modifiers is added after this calculation.
- Template:Nbt: Enables a charge-type attack when using the item where, while being used, the damage is dealt along a ray every tick based on the relative speed of the entities
</ref> Defaults to 1.0.
- Template:NbtTemplate:Nbt: Optional Minecraft:sound event to play when the weapon is engaged.
- Template:NbtTemplate:Nbt: Optional Minecraft:sound event to play when the weapon hits an entity.
Example: Template:Command
- Gives an amethyst shard which can perform a charge attack after a 1-second delay. The attack can damage entities for 3 seconds, knock them back for the first 2 seconds and dismount them for the first second. Hitting a target with the attack plays an amethyst sound.
lock
- Template:Nbt: Parent tag.
Example 1: Template:Command
- Gives a chest that is locked, opening only if the player is holding an item with the same model as a Diamond.
Example 2: Template:Command
- Gives a furnace that opens only if the player is holding an item with the custom name "Furnace Key".
Example 3: Template:Command
- Gives a barrel that opens only if the player is holding exactly 6 oak planks or 6 Minecraft:diamonds that has the custom data Template:Cd
lodestone_tracker
Example: Template:Command
- Gives a compass that points toward a lodestone that is located in the Overworld at x=1,y=2,z=3
lore
- Template:Nbt: Parent tag.
Example 1: Template:Command
- Gives a stick with lore in its tooltip.
Example 2: Template:Command
- Gives a diamond that has lore in its tooltip. The color of the lore is gold, and its italics have been removed.
Example 3: Template:Command
- Gives an emerald that has 2 lines of lore in its tooltip. The first line has a golden color, and the second has a yellow color. Both lines have had their italics removed.
map_color
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a filled map with red markings on item texture.
map_decorations
map_id
- Template:Nbt: Parent tag.
max_damage
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a diamond pickaxe that can only be used 4 times before breaking.
max_stack_size
Example: Template:Command
- Gives a stack of 5 acacia boats all in a single slot.
minimum_attack_charge
Example: Template:Command
- Gives a diamond sword that can only attack once the attack indicator is at least half full.
note_block_sound
Example: Template:Command
- Gives a Player Head of the minecraftWiki. If placed on a Note Block, the Note Block plays the "Item Pickup" sound every time it's activated.
ominous_bottle_amplifier
piercing_weapon
- Template:Nbt: Parent tag.
- Template:Nbt: Melee attacks using this item damage multiple entities along a ray, instead of only a single entity. Also prevents this item from being used to mine blocks.
- Template:Nbt: Whether the attack deals knockback. Defaults to true.
- Template:Nbt: Whether the attack dismounts the target. Defaults to false.
- Template:NbtTemplate:Nbt: Optional Minecraft:sound event to play when a player attacks with the weapon.
- Template:NbtTemplate:Nbt: Optional Minecraft:sound event to play when the weapon hits an entity.
- Template:Nbt: Melee attacks using this item damage multiple entities along a ray, instead of only a single entity. Also prevents this item from being used to mine blocks.
Example: Template:Command
- Gives a blaze rod which whose melee attack pierces targets, dealing 1 damage to each, with fiery and explosive sounds accompanying the attacks.
pot_decorations
Example: Template:Command
- Gives a Minecraft:decorated pot with sherds: skull, heart and blade on its faces
potion_contents
potion_duration_scale
Example: Template:Command
- Gives a Potion of Swiftness that has its default time doubled from 3 Minutes to 6 Minutes.
profile
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a player head of MinecraftWiki.
provides_banner_patterns
Example: Template:Command
- Gives a diamond that can provide the globe banner pattern to a banner.
provides_trim_material
rarity
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives an iron sword with a light purple name.
recipes
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a knowledge book that, when used, gives the player the recipes listed inside the component.
repair_cost
- Template:Nbt: Parent tag.
repairable
- Template:Nbt: Parent tag.
- Template:Nbt: Allows the item to be repaired, if damageable, in an anvil using the specified ingredient. Also repairs equipped items in the body slot of a tamed wolf.
- Template:NbtTemplate:Nbt: Item, list of Items, or hash-prefixed Item Tag matching what can be used to repair this item.
- Template:Nbt: Allows the item to be repaired, if damageable, in an anvil using the specified ingredient. Also repairs equipped items in the body slot of a tamed wolf.
Example: Template:Command
- Gives a diamond sword that can be repaired with sticks in an anvil.
stored_enchantments
- Template:Nbt: Parent tag.
- Template:Nbt: Contains a map of inactive Minecraft:enchantments and their levels. Adding this component to any item other than an Minecraft:enchanted book does nothing except add text to the item's tooltip. If this component is removed from an enchanted book, the item can no longer be combined with other enchanted books. If present on an item, the enchantments are listed in the item's tooltip. The order of the enchantments in the tooltip is defined by the
#minecraft:tooltip_orderenchantment tag.- Template:Nbt: A single key-value pair, where the key is the Minecraft:resource location of an enchantment, and the value is the level.
- Template:Nbt: Contains a map of inactive Minecraft:enchantments and their levels. Adding this component to any item other than an Minecraft:enchanted book does nothing except add text to the item's tooltip. If this component is removed from an enchanted book, the item can no longer be combined with other enchanted books. If present on an item, the enchantments are listed in the item's tooltip. The order of the enchantments in the tooltip is defined by the
sulfur_cube_content
- Template:Nbt: Parent tag.
- Template:Nbt: The item stored inside the Minecraft:sulfur cube. When present on a sulfur cube entity, this component doubles as the Template:Cd slot (Template:Cd equipment slot). When present on an item, gray italic text is added to the tooltip that says "Contains: Template:Cd".
suspicious_stew_effects
swing_animation
- Template:Nbt: Parent tag.
- Template:Nbt: Allows modification of the swinging animation.
- Template:Nbt: The type of swinging animation. Can be Template:Cd, Template:Cd, Template:Cd. Defaults to Template:Cd.
- Template:Nbt: A positive integer that determines the animation's duration in Minecraft:ticks. Defaults to Template:Cd.
- Template:Nbt: Allows modification of the swinging animation.
tool
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives an oak fence that has the properties of a pickaxe.
tooltip_display
Example 1: Template:Command
- Gives a diamond sword that is enchanted with Sharpness I, but doesn't show the enchantments in the tooltip.
Example 2: Template:Command
- Gives a diamond sword that when hovered, it shows no tooltip at all.
tooltip_style
- Template:Nbt: Parent tag.
- Template:Nbt: The Minecraft:resource location of the custom sprites for the Minecraft:tooltip background and frame which references textures /assets/<namespace>/textures/gui/sprites/tooltip/<id>_background and /assets/<namespace>/textures/gui/sprites/tooltip/<id>_frame. Instead of falling back to the default value, invalid specifications will use the Minecraft:missing texture.
trim
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives Minecraft:leather pants with the "host" pattern made of emerald.
unbreakable
- Template:Nbt: Parent tag.
- Template:Nbt: If present on an item, the item cannot lose durability, its durability bar is hidden, and a blue "Unbreakable" text is added to its tooltip.
Example: /give @p wooden_spear[unbreakable={}]
use_cooldown
- Template:Nbt: Parent tag.
- Template:Nbt: If present, this item applies a Minecraft:use cooldown to all items of the same type when it has been used.
- Template:Nbt: The use cooldown duration in seconds.
- Template:Nbt: The unique Minecraft:resource location to identify this cooldown group. If present, the item is included in a use cooldown group and no longer shares cooldowns with its base item type, but instead with any other items that are part of the same use cooldown group. Optional.
- Template:Nbt: If present, this item applies a Minecraft:use cooldown to all items of the same type when it has been used.
Example: Template:Command
- Gives an ender pearl that has a 10 second cooldown after being used, and also applies that cooldown to any item that shares its
cooldown_group.- If other items in the inventory share the same
cooldown_group, but have differentseconds, then using that item applies thesecondsof itself to all other items in the inventory, rather than each item applying their ownsecondsto themselves.
- If other items in the inventory share the same
- Items can have their cooldowns disabled completely by removing the component with
[!use_cooldown].
use_effects
- Template:Nbt: Parent tag.
- Template:Nbt: Defines the vibrations and player movement penalties when an item with a continuous use action is being used.
- Template:Nbt: If the player can sprint during use. Defaults to Template:Cd.
- Template:Nbt: A ranged float (0.0-1.0 inclusive) speed multiplier inflicted during use. Defaults to Template:Cd.
- Template:Nbt: Whether using this item emits the Template:Cd and Template:Cd Minecraft:game events. Defaults to Template:Cd.
- Template:Nbt: Defines the vibrations and player movement penalties when an item with a continuous use action is being used.
use_remainder
- Template:Nbt: Parent tag.
- Template:Nbt: If present, replaces the item with a remainder item if its stack count has decreased after use.
Example 1: Template:Command
- Gives a splash potion, which after being thrown, leaves gunpowder.
Example 2: Template:Command
- Gives a cooked chicken, which after being used, turns into 2 bones named "Chicken Bone".
weapon
If present, the item acts as a weapon. For attack damage see the Template:DCL component.
- Template:Nbt: Parent tag.
Example 1: Template:Command
- Gives a stick that has 10 durability, and loses 1 durability for each attack performed.
Example 2: Template:Command
- Gives an iron sword that disables shields for 5 seconds when used on them, but loses 10 durability for each attack performed.
writable_book_content
written_book_content
Entity variant components
Template:Work in progress Entity variant components are a group of components that are present in items like spawn eggs, mob buckets, paintings, item frames, etc. These components modify some of the properties of the entity stored within those items.
Here is a list of all entity variant components:
axolotl/variant
Example: Template:Command
- Gives a axolotl spawn egg that spawns a blue axolotl.
cat/collar
- Template:Nbt: Parent tag.
Example: Template:Command
- Gives a cat spawn egg that spawns a cat with a blue collar (once tamed).
cat/variant
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a cat spawn egg that spawns a Jellie (gray and white) cat.
chicken/variant
Example 1: Template:Cmd
- Gives a chicken spawn egg that spawns a cold chicken.
Example 2: Template:Cmd
- Gives an egg that has a chance to hatch a cold chicken.
cow/variant
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a cow spawn egg that spawns a cold cow.
fox/variant
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a fox spawn egg that spawns a snow fox.
frog/variant
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a frog spawn egg that spawns a cold frog.
horse/variant
Example: Template:Cmd
- Gives a horse spawn egg that spawns a chestnut horse.
llama/variant
Example: Template:Cmd
- Gives a llama spawn egg that spawns a gray llama.
mooshroom/variant
Example: Template:Cmd
- Gives a mooshroom spawn egg that spawns a brown mooshroom.
painting/variant
Example: Template:Cmd
- Gives a painting that places the "Paradisträd" painting.
parrot/variant
Example: Template:Cmd
- Gives a parrot spawn egg that spawns a blue parrot.
pig/variant
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a pig spawn egg that spawns a warm pig.
rabbit/variant
Example: Template:Cmd
- Gives a rabbit spawn egg that spawns an evil rabbit.
salmon/size
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a salmon spawn egg that spawns a large salmon.
sheep/color
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a sheep spawn egg that spawns a sheep with blue wool.
shulker/color
Example: Template:Cmd
- Gives a shulker spawn egg that spawns a red shulker.
tropical_fish/base_color
tropical_fish/pattern
tropical_fish/pattern_color
Example: Template:Cmd
- Gives a tropical fish spawn egg that spawns a red-blue snooper tropical fish.
villager/variant
Example: Template:Cmd
- Gives a villager spawn egg that spawns a desert villager.
wolf/collar
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a wolf spawn egg that spawns a wolf with a blue collar (when tamed).
wolf/sound_variant
Example: Template:Cmd
- Gives a wolf spawn egg that spawns a cute wolf.
wolf/variant
- Template:Nbt: Parent tag.
Example: Template:Cmd
- Gives a wolf spawn egg that spawns a rusty wolf.
Non-encoded components
These data components exist and are used by the game internally, but are not encoded on items. Therefore, they cannot be used in commands, nor seen with Template:Command.
additional_trade_cost
- Template:Nbt: Parent tag.
- Template:Nbt: Used on the Template:Cd item of a villager trade to add to the Template:Cd of the Template:Cd item.
creative_slot_lock
- Template:Nbt: Parent tag.
- Template:Nbt: Only used internally to lock the informational Minecraft:paper items in the Minecraft:creative inventory. If set, this item cannot be taken out of its slot.
map_post_processing
- Template:Nbt: Parent tag.
- Template:Nbt: Only used internally when this Minecraft:filled map has been duplicated or locked in a Minecraft:crafting table or a Minecraft:cartography table. Can be 0 (lock) or 1 (scale), adding the "Locked" line or "Scale" line in this item's tooltip, respectively.
Exclusive to joke versions
The following components were added and used in April Fools' Day joke snapshots.
Minecraft:24w14potato
clicks
- Template:Nbt: Parent tag.
- Template:Nbt: The number of times this Minecraft:poisonous potato plant has been clicked in the inventory.
contacts_messages
- Template:Nbt: Parent tag.
- Template:Nbt: Used by the Minecraft:poisonous potato plant.
explicit_foil
- Template:Nbt: Parent tag.
- Template:Nbt: Whether or not this item should display a glint.
fletching
- Template:Nbt: Parent tag.
- Template:Nbt: Information about this Minecraft:fletching table.
- Template:Nbt: A single character defining the quality of this block.
- Template:Nbt: A single character defining the impurity of this block.
- Template:Nbt: A single character defining the impurity of the next level of this block.
- Template:NbtTemplate:Sic: The process time of this block, in ticks.
- Template:Nbt: Whether this block has been explored.
- Template:Nbt: Information about this Minecraft:fletching table.
heat
- Template:Nbt: Parent tag.
- Template:Nbt: Information about this Minecraft:hot potato.
- Template:Nbt: The amount of heat. Has a maximum value of 200.
- Template:Nbt: The inventory slot this item is in.
- Template:Nbt: The UUID of the entity currently holding this item.
- Template:Nbt: Information about this Minecraft:hot potato.
hovered
- Template:Nbt: Parent tag.
- Template:Nbt: Whether or not this Minecraft:poisonous potato plant is the last item stack hovered in the inventory.
lubrication
- Template:Nbt: Parent tag.
- Template:Nbt
- Template:Nbt: The level of slipperiness this item has when thrown on the ground.
- Template:Nbt
potato_bane
- Template:Nbt: Parent tag.
- Template:Nbt: Used by the Minecraft:potato peeler.
- Template:Nbt: The amount of bonus damage applied to potato mobs.
- Template:Nbt: Used by the Minecraft:potato peeler.
resin
- Template:Nbt: Parent tag.
- Template:Nbt: Information about this Minecraft:toxic resin.
- Template:Nbt: A single character defining the quality of this item. Used to prefix the "Clarity" line on the tooltip.
- Template:Nbt: A single character defining the impurity of this item. Used to prefix the "Impurities" line on the tooltip.
- Template:Nbt: Information about this Minecraft:toxic resin.
secret_message
- Template:Nbt: Parent tag.
- Template:Nbt: Used by the Minecraft:poisonous potato plant.
snek
- Template:Nbt: Parent tag.
- Template:Nbt: Information about this Minecraft:snektato.
- Template:Nbt: Whether or not this item has been eaten yet. When Template:Cd, its name is "Venomous Potato" and its texture is different.
- Template:Nbt: Information about this Minecraft:snektato.
undercover_id
- Template:Nbt: Parent tag.
- Template:Nbt: Used by the Minecraft:poisonous potato plant.
views
- Template:Nbt: Parent tag.
- Template:Nbt: Used by the Minecraft:poisonous potato plant.
xp
- Template:Nbt: Parent tag.
- Template:Nbt: The amount of experience points granted by this Minecraft:potato of knowledge.
Minecraft:25w14craftmine
dimension_id
- Template:Nbt: Parent tag.
- Template:Nbt: The resource location of the dimension this mine item will teleport the player to when placed on a Minecraft:mine revisitor and used.
exchange_value
- Template:Nbt: Parent tag.
- Template:Nbt: The value of the item, which is used to determine how much experience the player gains from it when exiting a mine.
instant_room
- Template:Nbt: Parent tag.
- Template:Nbt: The room this Minecraft:shimmering key opens.
- Template:Nbt: The resource location of the structure. The key can only open a room if a structure file with the specified name exists inside the Template:Cd folder under the specified namespace in a Minecraft:data pack.
- Template:Nbt: The room this Minecraft:shimmering key opens.
mine_active
- Template:Nbt: Parent tag.
- Template:Nbt: Is set on the mine item in the Minecraft:mine crafter when the player is inside a mine.
mine_completed
- Template:Nbt: Parent tag.
- Template:Nbt: Whether the mine this mine item refers to was completed. Determines the color of the glint on the item (green if completed, red if failed).
mob_trophy/type
- Template:Nbt: Parent tag.
- Template:Nbt: Information about this Minecraft:mob trophy.
- Template:Nbt: Whether the mob inside this mob trophy has an enchantment glint on it. Also adds the text "Oooh, shiny!" to the tooltip.
- Template:Nbt: The resource location for the entity type inside this mob trophy.
- Template:Nbt: Information about this Minecraft:mob trophy.
sky
- Template:Nbt: Parent tag.
- Template:Nbt: Information about this Minecraft:sky box.
- Template:Nbt: The type of sky that sky blocks render. Must be one of Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd.
- If the value is Template:Cd, there are additional fields that are required:
- Template:Nbt: A resource location pointing to a texture asset.
- Template:Nbt: The number of times the texture will be tiled horizontally and vertically on each plane of the cube.
- Template:Nbt: Is set to 400.0 for Minecraft:sky boxes in the boiler room.Template:More info needed
- Template:NbtTemplate:NbtTemplate:Nbt: A text component that will be shown as the name of the sky in the "Sky:" line of the tooltip.
- Template:Nbt: Information about this Minecraft:sky box.
special_mine
- Template:Nbt: Parent tag.
- Template:Nbt: The resource location of the special mine this mine item teleports the player to.
trophy/type
- Template:Nbt: Parent tag.
- Template:Nbt: The type of this trophy. Must be one of Template:Cd, Template:Cd, Template:Cd.
world_effect_uhint
- Template:Nbt: Parent tag.
world_effect_unlock
- Template:Nbt: Parent tag.
world_modifiers
- Template:Nbt: Parent tag.
- Template:Nbt: The Minecraft:mine ingredients included in the mine this mine item teleports the player to.
- Template:Nbt: List of resource locations of world modifiers included in the mine.
- Template:Nbt: A world modifier.
- Template:Nbt: Whether to show the mine ingredients in the tooltip of this mine item.
- Template:Nbt: List of resource locations of world modifiers included in the mine.
- Template:Nbt: The Minecraft:mine ingredients included in the mine this mine item teleports the player to.
Minecraft:26w14a
follow
- Template:Nbt: Parent tag.
History
Notes
Template:Navbox Java Edition technical
Minecraft:de:Gegenstandsdaten Minecraft:fr:Format de composant de données Minecraft:ja:データコンポーネント Minecraft:ko:데이터 구성 요소 형식 Minecraft:pt:Formato de componente de dado Minecraft:uk:Формат компонента даних Minecraft:zh:数据组件