Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Data component format

From SAS Gaming Wiki
Revision as of 11:09, 12 April 2026 by SyncBot (talk | contribs) (Sync: new page from Minecraft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:RedirectTemplate: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. Not all characteristics of items are covered by data components. For properties of items that are defined by code and cannot be modified through components, 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.

Template:TOC

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

Template:For

Every item type (item ID) has a set of default data components. Item stacks must specify an item ID, which implicity sets these default components, but they may be overriden 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" />

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 transfering 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.

{{#lst:Block entity format|nbt 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

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.

Example: Template:Command

  • Gives a black banner with a red triangle and white cross pattern.

base_color

Example: Template:Command

  • Gives a lime shield.

bees

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

block_state

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

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.

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.

Minecraft:Data component format/can place on

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.

Example: Template:Command

  • Gives a gold ingot that can be eaten in 3 seconds and upon consuming, clears all effects.

container

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

Example: Template:Command

  • Gives an iron sword with custom data {foo:1}.

custom_model_data

Example:

Template:Command
  • Gives a bone with custom model data. The colors list 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.

Example:

Template:Command
  • Gives a stick named "Magic Wand" in light purple non-italicized text.

damage

Example: Template:Command

  • Gives a diamond axe with 500 points of damage.

damage_resistant

damage_type

Example: Template:Command

  • Gives a diamond sword that deals "campfire" type damage.

death_protection

Example: Template:Command

  • Gives a nether star that protects the holder from death and when did so, removes all status effects from the holder.

debug_stick_state

Example: Template:Command

dye

Example: Template:Command

  • Gives a blue dye item that acts like a red dye.

dyed_color

Example: Template:Command

or: Template:Command

or: Template:Command

  • Gives a blueish-green leather helmet.

enchantable

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

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

Example: Template:Command

  • Gives an armor stand that is small when placed down.

equippable

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

food

If present and the Template:DCL component are also present on this item, Minecraft:foxes consider the item as consumable food.

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

Example: Template:Command

  • Gives a nether star that can be equipped in the head slot and if on the head, allows the player to glide.

instrument

Example 1: Template:Command

Example 2: Template:Command

  • Gives a goat horn that plays the entity.creeper.primed sound.

intangible_projectile

Example: Template:Command

item_model

Example: Template:Command

  • Gives a netherite sword that looks like a diamond sword.

item_name

jukebox_playable

Example: Template:Command

  • Gives a diamond that plays Pigstep when inserted into a jukebox

kinetic_weapon

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

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

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

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

Example: Template:Command

  • Gives a filled map with red markings on item texture.

Template:Calculator

map_decorations

map_id

max_damage

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

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

potion_contents

Template:Calculator

potion_duration_scale

Example: Template:Command

  • Gives a Potion of Swiftness that has its default time doubled from 3 Minutes to 6 Minutes.

profile

Example: Template:Command

  • Gives a player head of MinecraftWiki.

Template:Calculator

provides_banner_patterns

Example: Template:Command

  • Gives a diamond that can provide the globe banner pattern to a banner.

provides_trim_material

rarity

Example: Template:Command

  • Gives an iron sword with a light purple name.

recipes

Example: Template:Command

  • Gives a knowledge book that, when used, gives the player the recipes listed inside the component.

repair_cost

repairable

Example: Template:Command

  • Gives a diamond sword that can be repaired with sticks in an anvil.

stored_enchantments

sulfur_cube_content

Template:In development

suspicious_stew_effects

swing_animation

tool

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

trim

Example: Template:Command

unbreakable

Minecraft:Data component format/unbreakableExample: /give @p wooden_spear[unbreakable={}]

use_cooldown

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 different seconds, then using that item applies the seconds of itself to all other items in the inventory, rather than each item applying their own seconds to themselves.
  • Items can have their cooldowns disabled completely by removing the component with [!use_cooldown].

use_effects

use_remainder

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.

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:

Template:Columns-list

axolotl/variant

Example: Template:Command

  • Gives a axolotl spawn egg that spawns a blue axolotl.

cat/collar

Example: Template:Command

  • Gives a cat spawn egg that spawns a cat with a blue collar (once tamed).

cat/variant

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

Example: Template:Cmd

  • Gives a cow spawn egg that spawns a cold cow.

fox/variant

Example: Template:Cmd

  • Gives a fox spawn egg that spawns a snow fox.

frog/variant

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

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

Example: Template:Cmd

  • Gives a salmon spawn egg that spawns a large salmon.

sheep/color

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

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

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.

creative_slot_lock

map_post_processing

additional_trade_cost

Template:In development

Exclusive to joke versions

The following components were added and used in April Fools' Day joke snapshots.

Minecraft:24w14potato

Template:Collapse

clicks

contacts_messages

explicit_foil

fletching

heat

hovered

lubrication

potato_bane

resin

secret_message

snek

undercover_id

views

xp

Template:Collapse

Minecraft:25w14craftmine

Template:Collapse

dimension_id

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

mine_active

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

sky

special_mine

trophy/type

world_effect_uhint

world_effect_unlock

world_modifiers

Template:Collapse

History

Template:Info needed section Template:HistoryTable

Notes

Template:Notelist

Navigation

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:数据组件

Contents