Minecraft:Data component format: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (19 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}}. | ||
When used by [[Minecraft:item]]s, they are referred as '''item components''' or '''item stack components'''. They can exist anywhere that an item is stored, such as the [[Minecraft:Player.dat format|player's inventory]], container [[Minecraft:Block entity format|block entities]], and [[Minecraft:structure file]]s. | When used by [[Minecraft:item]]s, they are referred as '''item components''' or '''item stack components'''. They can exist anywhere that an item is stored, such as the [[Minecraft:Player.dat format|player's inventory]], container [[Minecraft:Block entity format|block entities]], and [[Minecraft:structure file]]s. 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. | 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. | ||
| Line 24: | Line 24: | ||
{{for|the legacy format before 1.20.5|Item format/Before 1.20.5}} | {{for|the legacy format before 1.20.5|Item format/Before 1.20.5}} | ||
Every item type (item ID) has a set of ''default'' data components. Item stacks must specify an item ID, which | 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: | When saved in the [[Minecraft:NBT format]], items are written as a compound with the following tags: | ||
| Line 40: | Line 40: | ||
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. | 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 | Some NBT data on block entities are treated as data components when transferring data between items and blocks. For example, the <code>Items</code> field in a chest is interpreted as the <code>minecraft:container</code> component, despite being labeled and structured differently. | ||
<div class="treeview"> | <div class="treeview"> | ||
| Line 63: | Line 63: | ||
* {{BlockLink|monster-spawner|block_entity_data|link=#block_entity_data}} | * {{BlockLink|monster-spawner|block_entity_data|link=#block_entity_data}} | ||
* {{BlockLink|oak-stairs|block_state|link=#block_state}} | * {{BlockLink|oak-stairs|block_state|link=#block_state}} | ||
* {{ItemLink|wooden-hoe|block_transformer|link=#block_transformer}}{{upcoming|java 26.3}} | |||
* {{ItemLink|shield|blocks_attacks|link=#blocks_attacks}} | * {{ItemLink|shield|blocks_attacks|link=#blocks_attacks}} | ||
* {{ItemLink|wooden-sword|break_sound|link=#break_sound}} | * {{ItemLink|wooden-sword|break_sound|link=#break_sound}} | ||
* {{ItemLink|blaze-powder|brewing_fuel|link=#brewing_fuel}}{{upcoming|java 26.3}} | |||
* {{ItemLink|tropical-fish-bucket|bucket_entity_data|link=#bucket_entity_data}} | * {{ItemLink|tropical-fish-bucket|bucket_entity_data|link=#bucket_entity_data}} | ||
* {{ItemLink|bundle|bundle_contents|link=#bundle_contents}} | * {{ItemLink|bundle|bundle_contents|link=#bundle_contents}} | ||
| Line 70: | Line 72: | ||
* {{BlockLink|cobblestone|can_place_on|link=#can_place_on}} | * {{BlockLink|cobblestone|can_place_on|link=#can_place_on}} | ||
* {{ItemLink|crossbow|charged_projectiles|link=#charged_projectiles}} | * {{ItemLink|crossbow|charged_projectiles|link=#charged_projectiles}} | ||
* {{BlockLink|composter|compostable|link=#compostable}}{{upcoming|java 26.3}} | |||
* {{ItemLink|golden-apple|consumable|link=#consumable}} | * {{ItemLink|golden-apple|consumable|link=#consumable}} | ||
* {{BlockLink|shulker-box|container|link=#container}} | * {{BlockLink|shulker-box|container|link=#container}} | ||
* {{BlockLink|chest|container_loot|link=#container_loot}} | * {{BlockLink|chest|container_loot|link=#container_loot}} | ||
* {{ItemLink|coal|cooking_fuel|link=#cooking_fuel}}{{upcoming|java 26.3}} | |||
* {{BlockLink|barrier|custom_data|link=#custom_data}} | * {{BlockLink|barrier|custom_data|link=#custom_data}} | ||
* {{ItemLink|diamond|custom_model_data|link=#custom_model_data}} | * {{ItemLink|diamond|custom_model_data|link=#custom_model_data}} | ||
| Line 107: | Line 111: | ||
* {{ItemLink|egg|max_stack_size|link=#max_stack_size}} | * {{ItemLink|egg|max_stack_size|link=#max_stack_size}} | ||
* {{ItemLink|stone-spear|minimum_attack_charge|link=#minimum_attack_charge}} | * {{ItemLink|stone-spear|minimum_attack_charge|link=#minimum_attack_charge}} | ||
* {{BlockLink|creeper-head|mob_visibility|link=#mob_visibility}}{{upcoming|java 26.3}} | |||
* {{BlockLink|note-block|note_block_sound|link=#note_block_sound}} | * {{BlockLink|note-block|note_block_sound|link=#note_block_sound}} | ||
* {{ItemLink|ominous-bottle|ominous_bottle_amplifier|link=#ominous_bottle_amplifier}} | * {{ItemLink|ominous-bottle|ominous_bottle_amplifier|link=#ominous_bottle_amplifier}} | ||
* {{ItemLink|diamond-spear|piercing_weapon|link=#piercing_weapon}} | * {{ItemLink|diamond-spear|piercing_weapon|link=#piercing_weapon}} | ||
* {{ | * {{BlockLink|decorated-pot|pot_decorations|link=#pot_decorations}} | ||
* {{ItemLink|potion|potion_contents|link=#potion_contents}} | * {{ItemLink|potion|potion_contents|link=#potion_contents}} | ||
* {{ItemLink|lingering-potion|potion_duration_scale|link=#potion_duration_scale}} | * {{ItemLink|lingering-potion|potion_duration_scale|link=#potion_duration_scale}} | ||
* {{BlockLink|player-head|profile|link=#profile}} | * {{BlockLink|player-head|profile|link=#profile}} | ||
* {{ItemLink|creeper-charge-banner-pattern|provides_banner_patterns|link=#provides_banner_patterns}} | * {{ItemLink|creeper-charge-banner-pattern|provides_banner_patterns|link=#provides_banner_patterns}} | ||
* {{ItemLink|danger-pottery-sherd|provides_pottery_pattern|link=#provides_pottery_pattern}}{{upcoming|java 26.3}} | |||
* {{ItemLink|raiser-armor-trim-smithing-template|provides_trim_material|link=#provides_trim_material}} | * {{ItemLink|raiser-armor-trim-smithing-template|provides_trim_material|link=#provides_trim_material}} | ||
* {{ItemLink|nether-star|rarity|link=#rarity}} | * {{ItemLink|nether-star|rarity|link=#rarity}} | ||
| Line 120: | Line 126: | ||
* {{EntityLink|experience-orb|repair_cost|link=#repair_cost}} | * {{EntityLink|experience-orb|repair_cost|link=#repair_cost}} | ||
* {{BlockLink|anvil|repairable|link=#repairable}} | * {{BlockLink|anvil|repairable|link=#repairable}} | ||
* {{BlockLink|oak-sign|sign_text_back|link=#sign_text_back}}{{upcoming|java 26.3}} | |||
* {{BlockLink|oak-sign|sign_text_front|link=#sign_text_front}}{{upcoming|java 26.3}} | |||
* {{ItemLink|enchanted-book|stored_enchantments|link=#stored_enchantments}} | * {{ItemLink|enchanted-book|stored_enchantments|link=#stored_enchantments}} | ||
* {{ItemLink|bucket-of-sulfur-cube|sulfur_cube_content|link=#sulfur_cube_content | * {{ItemLink|bucket-of-sulfur-cube|sulfur_cube_content|link=#sulfur_cube_content}} | ||
* {{ItemLink|suspicious-stew|suspicious_stew_effects|link=#suspicious_stew_effects}} | * {{ItemLink|suspicious-stew|suspicious_stew_effects|link=#suspicious_stew_effects}} | ||
* {{ItemLink|netherite-spear|swing_animation|link=#swing_animation}} | * {{ItemLink|netherite-spear|swing_animation|link=#swing_animation}} | ||
| Line 132: | Line 140: | ||
* {{ItemLink|golden-spear|use_effects|link=#use_effects}} | * {{ItemLink|golden-spear|use_effects|link=#use_effects}} | ||
* {{ItemLink|milk-bucket|use_remainder|link=#use_remainder}} | * {{ItemLink|milk-bucket|use_remainder|link=#use_remainder}} | ||
* {{ItemLink|bread|villager_food|link=#villager_food}}{{upcoming|java 26.3}} | |||
* {{ItemLink|honeycomb|waxed|link=#waxed}}{{upcoming|java 26.3}} | |||
* {{ItemLink|diamond-sword|weapon|link=#weapon}} | * {{ItemLink|diamond-sword|weapon|link=#weapon}} | ||
* {{ItemLink|book-and-quill|writable_book_content|link=#writable_book_content}} | * {{ItemLink|book-and-quill|writable_book_content|link=#writable_book_content}} | ||
| Line 188: | Line 198: | ||
{{/block entity data}} | {{/block entity data}} | ||
</div> | </div> | ||
''Example:'' {{command|give @s spawner[block_entity_data{{=}}{id:"mob_spawner",SpawnData:{entity:{id:"spider"<nowiki>}}</nowiki>}]}} | ''Example:'' {{command|give @s spawner[block_entity_data{{=}}{id:"mob_spawner",SpawnData:{entity:{id:"spider"<nowiki>}}</nowiki>}]}}* Gives a spider spawner. Placing this spawner requires the player to have [[Minecraft:Permission level|operator permissions]]. | ||
* Gives a spider spawner. Placing this spawner requires the player to have [[Minecraft:Permission level|operator permissions]]. | |||
=== block_state === | === block_state === | ||
| Line 199: | Line 208: | ||
''Example:'' {{command|give @s bamboo_slab[block_state{{=}}{type:"top"}]}} | ''Example:'' {{command|give @s bamboo_slab[block_state{{=}}{type:"top"}]}} | ||
* Gives a bamboo slab that is always placed in the top half of the block. | * Gives a bamboo slab that is always placed in the top half of the block. | ||
=== block_transformer === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/block transformer}}</div>''Example:'' {{command|give @s blaze_rod[minecraft:block_transformer{{=}}[{block_state_provider:{type:"simple_state_provider",state:{Name:"gold_block"<nowiki>}}</nowiki>,disallowed_faces:[up,down],sound:"block.stone.place"}]]}} | |||
* Gives a blaze rod which, when used on the side of a block, turns the block into a block of gold and plays a sound. If the player is in survival or adventure mode, the rod is consumed. | |||
=== blocks_attacks === | === blocks_attacks === | ||
| Line 204: | Line 220: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound|components}}: Parent tag. | * {{nbt|compound|components}}: Parent tag. | ||
{{/blocks_attacks}} | {{/blocks_attacks}}</div> | ||
</div> | |||
''Example:'' {{command|give @s diamond_sword[blocks_attacks{{=}}{disable_cooldown_scale:0,damage_reductions:[{types:[mob_attack,arrow,explosion],base:0,factor:0.5}],block_sound:block.anvil.place}]}} | ''Example:'' {{command|give @s diamond_sword[blocks_attacks{{=}}{disable_cooldown_scale:0,damage_reductions:[{types:[mob_attack,arrow,explosion],base:0,factor:0.5}],block_sound:block.anvil.place}]}} | ||
* 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. | * 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. | ||
| Line 217: | Line 232: | ||
''Example:'' {{command|give @s diamond_sword[break_sound{{=}}"item.wolf_armor.break"]}} | ''Example:'' {{command|give @s diamond_sword[break_sound{{=}}"item.wolf_armor.break"]}} | ||
* Gives a diamond sword that when runs out of durability, it plays the wolf armor break sound. | * Gives a diamond sword that when runs out of durability, it plays the wolf armor break sound. | ||
=== brewing_fuel === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/brewing fuel}} | |||
</div> | |||
''Example:'' {{command|give @s stick[brewing_fuel{{=}}{uses:"minecraft:brewing/uses_default",speed_multiplier:"minecraft:brewing/speed_default"}]}} | |||
* Gives a stick that can be used in brewing stands like blaze powder. | |||
=== bucket_entity_data === | === bucket_entity_data === | ||
| Line 267: | Line 292: | ||
* Gives a crossbow that is already charged with a spectral arrow. | * 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. | 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. | ||
=== compostable === | |||
{{in development|java||26.3|section=1}} | |||
If present, the item can be {{Control|used}} on the [[Minecraft:composter]], regardless of its value in {{cd|layers}}: | |||
* If the initial level of the composter is less than {{cd|7}}, the item is consumed and produces a sound and particle. | |||
* If the level is {{cd|7}}, the item is not consumed, but maintains the use animation. Items without this component cannot be used. | |||
* If the level is {{cd|8}}, as with any other item, when used it is not consumed and collects the [[Minecraft:bone meal]]. | |||
Additionally, the item with this component can be used in a composter ({{cd|level}} <7) by [[Minecraft:farmer]]s, and placed in it by [[Minecraft:hopper]], [[Minecraft:minecart with hopper]] and [[Minecraft:dispenser]]. | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/compostable}} | |||
</div> | |||
=== consumable === | === consumable === | ||
| Line 298: | Line 338: | ||
''Example:'' {{command|give @s chest[container_loot{{=}}{loot_table:"chests/desert_pyramid"}]}} | ''Example:'' {{command|give @s chest[container_loot{{=}}{loot_table:"chests/desert_pyramid"}]}} | ||
* Gives a chest that contains the desert pyramid loot when opened. | * Gives a chest that contains the desert pyramid loot when opened. | ||
=== cooking_fuel === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/cooking fuel}} | |||
</div> | |||
''Example:'' {{command|give @s cobblestone[cooking_fuel{{=}}{burn_time:"minecraft:cooking/time_coal",speed_multiplier:"minecraft:cooking/speed_default"}]}} | |||
* Gives a cobblestone block that provides the same fuel as a piece of coal. | |||
=== custom_data === | === custom_data === | ||
| Line 319: | Line 369: | ||
=== custom_name === | === 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. | 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. See also [[#item name|{{cd|item_name}}]], which specifies the default name of the item. | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound|components}}: Parent tag. | * {{nbt|compound|components}}: Parent tag. | ||
| Line 518: | Line 568: | ||
* {{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 === | ||
| Line 623: | Line 674: | ||
* Gives a diamond sword that can only attack once the attack indicator is at least half full. | * Gives a diamond sword that can only attack once the attack indicator is at least half full. | ||
=== | === mob_visibility === | ||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound|components}}: Parent tag. | * {{nbt|compound|components}}: Parent tag. | ||
{{/ | {{/mob_visibility}} | ||
</div> | </div> | ||
''Example:'' {{command|give @p minecraft:player_head[minecraft:profile{{=}}minecraftWiki,minecraft:note_block_sound{{=}}entity.item.pickup]}} | ''Example:'' {{command|give @s minecraft:chainmail_helmet[minecraft:mob_visibility{{=}}{targeting_entity_types:"minecraft:skeleton",visibility:0f}]}} | ||
* 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. | * Gives a chainmail helmet which prevents skeletons from detecting the wearer unless they are within 2 blocks. | ||
=== note_block_sound === | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/note block sound}} | |||
</div> | |||
''Example:'' {{command|give @p minecraft:player_head[minecraft:profile{{=}}minecraftWiki,minecraft:note_block_sound{{=}}entity.item.pickup]}} | |||
* 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 === | === ominous_bottle_amplifier === | ||
| Line 692: | Line 753: | ||
''Example:'' {{command|give @p diamond[provides_banner_patterns{{=}}'#minecraft:pattern_item/globe']}} | ''Example:'' {{command|give @p diamond[provides_banner_patterns{{=}}'#minecraft:pattern_item/globe']}} | ||
* Gives a diamond that can provide the globe banner pattern to a banner. | * Gives a diamond that can provide the globe banner pattern to a banner. | ||
=== provides_pottery_pattern === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/provides_pottery_pattern}} | |||
</div> | |||
=== provides_trim_material === | === provides_trim_material === | ||
| Line 733: | Line 801: | ||
''Example:'' {{command|/give @p diamond_sword[repairable{{=}}{items:"stick"}]}} | ''Example:'' {{command|/give @p diamond_sword[repairable{{=}}{items:"stick"}]}} | ||
* Gives a diamond sword that can be repaired with sticks in an anvil. | * Gives a diamond sword that can be repaired with sticks in an anvil. | ||
=== sign_text_back === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/sign_text_back}} | |||
</div> | |||
=== sign_text_front === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/sign text front}} | |||
</div> | |||
=== stored_enchantments === | === stored_enchantments === | ||
| Line 742: | Line 826: | ||
=== sulfur_cube_content === | === sulfur_cube_content === | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound|components}}: Parent tag. | * {{nbt|compound|components}}: Parent tag. | ||
| Line 803: | Line 885: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound|components}}: Parent tag. | * {{nbt|compound|components}}: Parent tag. | ||
{{/unbreakable}}''Example:'' <code>/[[Minecraft:Commands/give|give]] @p | {{/unbreakable}}''Example:'' <code>/[[Minecraft:Commands/give|give]] @p wooden_spear[unbreakable={}]</code> | ||
</div> | </div> | ||
| Line 834: | Line 916: | ||
''Example 2:'' {{command|/give @p cooked_chicken[use_remainder{{=}}{id:"minecraft:bone",components:{custom_name:{text:"Chicken Bone"<nowiki>}}</nowiki>,count:2}]}} | ''Example 2:'' {{command|/give @p cooked_chicken[use_remainder{{=}}{id:"minecraft:bone",components:{custom_name:{text:"Chicken Bone"<nowiki>}}</nowiki>,count:2}]}} | ||
* Gives a cooked chicken, which after being used, turns into 2 bones named "Chicken Bone". | * Gives a cooked chicken, which after being used, turns into 2 bones named "Chicken Bone". | ||
=== villager_food === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/villager_food}} | |||
</div> | |||
''Example:'' {{command|give @s minecraft:golden_apple[villager_food{{=}}{nutrition:12}] 1}} | |||
* Gives a [[Minecraft:golden apple]] that provides villagers with enough nutrition to breed all by itself. | |||
=== waxed === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
{{/waxed}} | |||
</div> | |||
''Example:'' {{command|give @s minecraft:oak_sign[waxed{{=}}{},sign_text_front{{=}}{messages:["","Hello there!","",""]}] 1}} | |||
* Gives an oak [[Minecraft:sign]] with the text "Hello there!" waxed in place. | |||
=== weapon === | === weapon === | ||
| Line 872: | Line 974: | ||
* {{EntityLink|chicken|chicken/variant|link=#chicken/variant}} | * {{EntityLink|chicken|chicken/variant|link=#chicken/variant}} | ||
* {{EntityLink|cow|cow/variant|link=#cow/variant}} | * {{EntityLink|cow|cow/variant|link=#cow/variant}} | ||
* {{EntityLink|cushion|cushion/color|link=#cushion/color}}{{upcoming|java 26.3}} | |||
* {{EntityLink|fox|fox/variant|link=#fox/variant}} | * {{EntityLink|fox|fox/variant|link=#fox/variant}} | ||
* {{EntityLink|frog|frog/variant|link=#frog/variant}} | * {{EntityLink|frog|frog/variant|link=#frog/variant}} | ||
| Line 935: | Line 1,038: | ||
''Example:'' {{cmd|/give @s cow_spawn_egg[cow/variant{{=}}"cold"]}} | ''Example:'' {{cmd|/give @s cow_spawn_egg[cow/variant{{=}}"cold"]}} | ||
* Gives a cow spawn egg that spawns a cold cow. | * Gives a cow spawn egg that spawns a cold cow. | ||
=== cushion/color === | |||
{{in development|java||26.3|section=1}} | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
** {{/cushion/color}} | |||
</div> | |||
''Example:'' {{cmd|/give @s red_cushion[cushion/color{{=}}"purple"]}} | |||
* Gives a red [[Minecraft:cushion]] item that spawns a purple cushion entity. | |||
=== fox/variant === | === fox/variant === | ||
| Line 1,323: | Line 1,436: | ||
**** {{nbt|string}}: A world modifier. | **** {{nbt|string}}: A world modifier. | ||
*** {{nbt|boolean|include_description}}: Whether to show the mine ingredients in the tooltip of this mine item. | *** {{nbt|boolean|include_description}}: Whether to show the mine ingredients in the tooltip of this mine item. | ||
</div> | |||
{{Collapse|tail=1}} | |||
=== [[Minecraft:26w14a]] === | |||
{{Collapse|title=List of the components|head=1}} | |||
==== follow ==== | |||
<div class="treeview"> | |||
* {{nbt|compound|components}}: Parent tag. | |||
** {{nbt|boolean|minecraft:follow}}: {{more info needed}} | |||
</div> | </div> | ||
{{Collapse|tail=1}} | {{Collapse|tail=1}} | ||
| Line 1,396: | Line 1,520: | ||
|{{HistoryLine|||dev=snap5|Added {{cd|minecraft:dye}}.}} | |{{HistoryLine|||dev=snap5|Added {{cd|minecraft:dye}}.}} | ||
|{{HistoryLine|||dev=pre1|{{cd|minecraft:provides_banner_patterns}}: The component now also accepts an ID or a list of IDs in addition to a tag.|{{cd|minecraft:blocks_attacks}}: The field {{cd|bypassed_by}} now also accepts an ID or a list of IDs in addition to a tag.|{{cd|minecraft:damage_resistant}}: The field types now also accepts an ID or a list of IDs in addition to a tag.}} | |{{HistoryLine|||dev=pre1|{{cd|minecraft:provides_banner_patterns}}: The component now also accepts an ID or a list of IDs in addition to a tag.|{{cd|minecraft:blocks_attacks}}: The field {{cd|bypassed_by}} now also accepts an ID or a list of IDs in addition to a tag.|{{cd|minecraft:damage_resistant}}: The field types now also accepts an ID or a list of IDs in addition to a tag.}} | ||
|{{HistoryLine||26.2|dev=snap1|Added {{cd|sulfur_cube_content}} component.}} | |{{HistoryLine||26.2|dev=snap1|Added {{cd|sulfur_cube_content}} component.}} | ||
|{{HistoryLine|upcoming java}} | |||
|{{HistoryLine||26.3|dev=snap1|Added {{cd|minecraft:provides_pottery_pattern}} component.|{{cd|minecraft:pot_decorations}}: Instead of taking a list of 4 item IDs, this component now takes an object with 4 optional item stack field.|{{cd|minecraft:trim_material}}: The format of inline material definitions has been updated. | |||
|{{cd|minecraft:instrument}}: The format of elements in the instrument registry have been updated.}} | |||
|{{HistoryLine|||dev=snap2|Added {{cd|minecraft:block_transformer}}.}} | |||
|{{HistoryLine|||dev=snap3|Added {{cd|minecraft:compostable}}.|{{cd|minecraft:block_transformer}}: Added optional boolean field {{cd|update_from_neighbors}}.}} | |||
|{{HistoryLine|||dev=snap4|Added {{cd|minecraft:cooking_fuel}}, {{cd|minecraft:brewing_fuel}}, {{cd|minecraft:sign_text_front}}, {{cd|minecraft:sign_text_back}}, {{cd|minecraft:waxed}}, {{cd|minecraft:cushion/color}}, {{cd|minecraft:villager_food}}, and {{cd|minecraft:mob_visibility}} components.}} | |||
}} | }} | ||
| Line 1,413: | Line 1,542: | ||
[[Minecraft:ko:데이터 구성 요소 형식]] | [[Minecraft:ko:데이터 구성 요소 형식]] | ||
[[Minecraft:pt:Formato de componente de dado]] | [[Minecraft:pt:Formato de componente de dado]] | ||
[[Minecraft:ru:Формат компонента данных]] | |||
[[Minecraft:uk:Формат компонента даних]] | [[Minecraft:uk:Формат компонента даних]] | ||
[[Minecraft:zh:数据组件]] | [[Minecraft:zh:数据组件]] | ||
Latest revision as of 11:02, 23 July 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.
block_transformer
- Template:Nbt: Parent tag.
- Template:Nbt: The game iterates through this list until it finds an element whose Minecraft:block state provider returns a result.
- Template:Nbt: A single object in the list.
- Template:Nbt: A Minecraft:block state provider which provides the state for the transformed block. Only block state providers used in world generation are allowed.
- Template:NbtTemplate:Nbt: Optional. Template:Json ref to play upon successful transformation. Defaults to none.
- Template:Nbt: Optional. The particle to use for the interaction. Can be one of Template:Cd. Defaults to Template:Cd.
- Template:Nbt: Optional. Interacting with one of the specified faces will not transform the block.
- Template:Nbt: An element in the list. Can be one of Template:Cd.
- Template:Nbt: Optional. The Minecraft:loot table to use for dropping items upon successful transformation. If not present, no loot is dropped.
- Template:Nbt: Optional. Where in the block space the dropped loot should spawn. Can be either Template:Cd (loot spawns at the center of the block space) or Template:Cd (loot spawns at the center of the face interacted with). Defaults to Template:Cd.
- Template:Nbt: Optional. Configures how nearby blocks should be affected by the transformation. Can be either Template:Cd (only the targeted block is affected) or Template:Cd (if input and output blocks are both copper chests of any weathering state, waxed or unwaxed, this transformation will affect both sides of a double chest).
- Template:Nbt: Optional. Whether or not the item should be consumed upon successful transformation, if it is stackable and the player is in survival or adventure mode. Defaults to Template:Cd.
- Template:Nbt: Optional. How much Minecraft:durability the item loses upon successful transformation, if it is not stackable and the player is in survival or adventure mode. Defaults to Template:Cd.
- Template:Nbt: A single object in the list.
- Template:Nbt: The game iterates through this list until it finds an element whose Minecraft:block state provider returns a result.
Example: Template:Command
- Gives a blaze rod which, when used on the side of a block, turns the block into a block of gold and plays a sound. If the player is in survival or adventure mode, the rod is consumed.
blocks_attacks
- Template:Nbt: Parent tag.
- Template:Nbt: When present, this item can be used like a shield to block attacks to the holding player.
- Template:Nbt: The amount of time (in seconds) that Template:Control must be held before successfully blocking attacks. Defaults to Template:Cd.
- Template:Nbt: The multiplier applied to the cooldown time for the item when attacked by a disabling attack (the multiplier for Template:Nbt on the [[Minecraft:Data component format#weapon|Template:Cd]] component). If set to Template:Cd, this item can never be disabled by attacks. Defaults to Template:Cd.
- Template:Nbt: A set of rules for how much and what kinds damage should be blocked in a given attack. Defaults to
[{base:0,factor:1,horizontal_blocking_angle:90}]which blocks all damage within a 90 degree angle.- Template:Nbt: A damage reduction field
- Template:NbtTemplate:Nbt: Template:Json ref to block. Defaults to all damage types.
- Template:Nbt: The constant amount of damage to be blocked. This is a required field.
- Template:Nbt: The fraction of the dealt damage to be blocked. This is a required field.
- Template:Nbt: strictly positive float — The maximum angle between the users facing direction and the direction of the incoming attack to be blocked. Defaults to Template:Cd.
- Template:Nbt: A damage reduction field
- Template:Nbt: Controls how much damage should be applied to the item from a given attack.
- Template:Nbt: The minimum amount of damage dealt by the attack before item damage is applied to the item. Defaults to Template:Cd.
- Template:Nbt: The constant amount of damage applied to the item, if threshold is passed. Defaults to Template:Cd.
- Template:Nbt: The fraction of the dealt damage that should be applied to the item, if threshold is passed. Defaults to Template:Cd.
- Template:NbtTemplate:Nbt: Template:Json ref to play when an attack is successfully blocked. Defaults to none.
- Template:NbtTemplate:Nbt: Template:Json ref to play when the item goes on its disabled cooldown due to an attack. Defaults to none.
- Template:Nbt: a damage type Minecraft:tag with Template:Cd of Minecraft:damage types that bypass the blocking. Defaults to none.
- Template:Nbt: When present, this item can be used like a shield to block attacks to the holding player.
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.
- Template:NbtTemplate:Nbt: Template:Json ref to play when the item runs out of durability and breaks.
Example: Template:Command
- Gives a diamond sword that when runs out of durability, it plays the wolf armor break sound.
brewing_fuel
- Template:Nbt: Parent tag.
- Template:Nbt: If present, this item can be consumed for fuel by Minecraft:brewing stands.
- Template:Nbt: The Minecraft:namespaced ID of a Minecraft:number provider, which is evaluated using the Template:Cd Minecraft:loot context to determine how many infusions will be fueled by destroying this item, with fractions rounded to the nearest whole number. The fuel item is consumed regardless of whether this evaluates to a positive number.
- Template:Nbt: The Minecraft:namespaced ID of a Minecraft:number provider. The number provider is evaluated using the Template:Cd Minecraft:loot context to determine how quickly infusions should complete during the time provided by this fuel item. Each infusion will take Template:Math ticks. If the evaluated value is Template:Cd or less, it is treated as Template:Cd. The provider is only evaluated once when the fuel is consumed, and the scaled brewing time is only calculated once when the infusion begins.
- Template:Nbt: If present, this item can be consumed for fuel by Minecraft:brewing stands.
Example: Template:Command
- Gives a stick that can be used in brewing stands like blaze powder.
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
- Template:Nbt: Parent tag.
- Template:Nbt: The items stored inside this Minecraft:bundle. Adding this component to any item changes that item to occupy 1/16 of the space of a bundle plus any items specified in the component, regardless of how of that item normally fit in a bundle. Shulker boxes with this component are still not able to be placed inside a bundle. If this component is removed from a Minecraft:bundle, it cannot be used by the player and the usual instruction and fullness bar does not appear in the tooltip.
- Template:Nbt: A single item stack.
- Template:Nbt: The items stored inside this Minecraft:bundle. Adding this component to any item changes that item to occupy 1/16 of the space of a bundle plus any items specified in the component, regardless of how of that item normally fit in a bundle. Shulker boxes with this component are still not able to be placed inside a bundle. If this component is removed from a Minecraft:bundle, it cannot be used by the player and the usual instruction and fullness bar does not appear in the tooltip.
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. If no fields are specified, any block will match.Template:Nbt include
- 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. If no fields are specified, any block will match.Template:Nbt include
- 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.
compostable
If present, the item can be Template:Control on the Minecraft:composter, regardless of its value in Template:Cd:
- If the initial level of the composter is less than Template:Cd, the item is consumed and produces a sound and particle.
- If the level is Template:Cd, the item is not consumed, but maintains the use animation. Items without this component cannot be used.
- If the level is Template:Cd, as with any other item, when used it is not consumed and collects the Minecraft:bone meal.
Additionally, the item with this component can be used in a composter (Template:Cd <7) by Minecraft:farmers, and placed in it by Minecraft:hopper, Minecraft:minecart with hopper and Minecraft:dispenser.
- Template:Nbt: Parent tag.
- Template:Nbt:
- Template:Nbt: Required. A Minecraft:number provider registry. Number of layers increased when using the item in an not-full composter (Template:Cd<7). To increase the compost level, the number needs to be greater than 0. The final level is a clamp between 0 and 7. Typically, a number provider results in Template:Cd or Template:Cd.
- Template:Nbt:
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.
- Template:Nbt: If present, this item can be consumed on use.
- Template:Nbt: The amount of seconds it takes for a player to consume the item. Defaults to 1.6.
- Template:Nbt: The animation used during consumption of the item. Must be one of Template:Cd. Defaults to
eat. - Template:NbtTemplate:Nbt: Template:Json ref used during and on completion of the item's consumption. Defaults to
entity.generic.eat. - Template:Nbt: Whether consumption particles are emitted while consuming this item. Defaults to
true. - Template:Nbt: A list of effects which take place as a result of consuming this item. Optional.
- Template:Nbt: A single consume effect.
- Template:Nbt: If present, this item can be consumed on use.
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.
cooking_fuel
- Template:Nbt: Parent tag.
- Template:Nbt: If present, this item can be burned for fuel by Minecraft:smelting blocks.
- Template:Nbt: The Minecraft:namespaced ID of a Minecraft:number provider, which is evaluated using the Template:Cd Minecraft:loot context to determine how many ticks of fuel will be provided by destroying this item, with fractions rounded to the nearest whole number. If the evaluated value is Template:Cd, the fuel item is not consumed on this tick.
- Template:Nbt: The Minecraft:namespaced ID of a Minecraft:number provider. The number provider is evaluated using the Template:Cd Minecraft:loot context to determine how quickly items should smelt during the burn time provided by this fuel item. Each ingredient will take Template:Math ticks to cook, where cooktime is specified in the recipe. If the evaluated value is Template:Cd or less, it is treated as Template:Cd. The provider is only evaluated once when the fuel is consumed, and the scaled cooking time is only calculated once when the ingredient starts cooking.
- Template:Nbt: If present, this item can be burned for fuel by Minecraft:smelting blocks.
Example: Template:Command
- Gives a cobblestone block that provides the same fuel as a piece of coal.
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. See also [[#item name|Template:Cd]], which specifies the default name of the item.
- 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.
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.
mob_visibility
- Template:Nbt: Parent tag.
- Template:Nbt: Represents the visibility percentage provided by an item with the appropriate minecraft:equippable component, modifying the range at which mobs are able to detect an entity.
- Template:NbtTemplate:Nbt: An entity ID, a list of namespaced entity IDs, or a hash-prefixed entity tag.
- Template:Nbt: The multiplier for the wearer's detectability by the aforementioned mobs. Valid range is Template:Cd to Template:Cd. A value of Template:Cd reduces the wearer's detectability by these mobs to 2 blocks.Template:Info needed A value of Template:Cd increases the detection radius tenfold. The maximum total detection multiplier from all equipped items with this component is 10.
- Template:Nbt: Represents the visibility percentage provided by an item with the appropriate minecraft:equippable component, modifying the range at which mobs are able to detect an entity.
Example: Template:Command
- Gives a chainmail helmet which prevents skeletons from detecting the wearer unless they are within 2 blocks.
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
- Template:Nbt: Parent tag.
- Template:NbtTemplate:Until: A list of the items (typically pottery sherds or bricks) applied on each face of this Minecraft:decorated pot. If the list is specified with less than 4 entries, the remaining ones default to Template:Cd. The first entry is the front face of the pot, and subsequent entries are the faces going clockwise around the pot. If this component is present on an item, the item's tooltip will list the translated names of each of the items in the same order.
- Template:Nbt: The ID of an item. Can be either Template:Cd or a Minecraft:sherd.
- Template:NbtTemplate:Upcoming: A map for face to the item stacks (typically pottery sherds or bricks). The faces can be empty. When used on a decorated pot, it defines the items that will be dropped from its faces when broken. If an item has the Template:DCL component, it defines the texture of the corresponding face.
- Template:Nbt: The item stack in the left side.
- Template:Nbt: The item stack in the back side.
- Template:Nbt: The item stack in the right side.
- Template:Nbt: The item stack in the front side.
- Template:NbtTemplate:Until: A list of the items (typically pottery sherds or bricks) applied on each face of this Minecraft:decorated pot. If the list is specified with less than 4 entries, the remaining ones default to Template:Cd. The first entry is the front face of the pot, and subsequent entries are the faces going clockwise around the pot. If this component is present on an item, the item's tooltip will list the translated names of each of the items in the same order.
Example: Template:Command
- Gives a Minecraft:decorated pot with sherds: skull, heart and blade on its faces
potion_contents
- Template:Nbt: Parent tag.
- Template:NbtTemplate:Nbt: The base potion, custom list of Minecraft:mob effects, and custom color contained in this Minecraft:potion, Minecraft:splash potion, Minecraft:lingering potion, Minecraft:tipped arrow, or Minecraft:area effect cloud. When present on an item, the Minecraft:mob effects are listed in the item's tooltip. If this and a
minecraft:consumablecomponent are present on an item, consuming the item will apply all of the effects from this component to the player or mob that consumed it. If defined as a string, corresponds to Template:Nbt.
- Template:NbtTemplate:Nbt: The base potion, custom list of Minecraft:mob effects, and custom color contained in this Minecraft:potion, Minecraft:splash potion, Minecraft:lingering potion, Minecraft:tipped arrow, or Minecraft:area effect cloud. When present on an item, the Minecraft:mob effects are listed in the item's tooltip. If this and a
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
- Template:Nbt: Parent tag.
- Template:NbtTemplate:Nbt: Template:Json ref. When present, this item can be placed in the pattern slot of a loom and provides the specified banner patterns.
Example: Template:Command
- Gives a diamond that can provide the globe banner pattern to a banner.
provides_pottery_pattern
- Template:Nbt: Parent tag.
- Template:Nbt: Template:Json ref. When present, this item provides the specified pattern when used in a Minecraft:decorated pot side.
provides_trim_material
- Template:Nbt: Parent tag.
- Template:NbtTemplate:Nbt: Template:Json ref. When present, this item provides the specified trim material when used in a trimming recipe.<ref group="note">To be used in the built-in smithing recipes, the item must also be in the Template:Cd tag.</ref>
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.
sign_text_back
- Template:Nbt: Parent tag.
- Template:Nbt: The text displayed on the back side of this Minecraft:sign. If present on an item, the lines of text are shown indented in the tooltip, with a line saying "Back text:" before them.
sign_text_front
- Template:Nbt: Parent tag.
- Template:Nbt: The text displayed on the front side of this Minecraft:sign. If present on an item, the lines of text are shown indented in the tooltip, with a line saying "Front text:" before them.
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.
- Template:Nbt: Contains the trim applied to this Minecraft:armor piece. If present on an item, information about the armor trim is added to the item's tooltip.
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".
villager_food
- Template:Nbt: Parent tag.
- Template:Nbt: If present, Minecraft:villagers will be able to pick up and eat the item.
- Template:Nbt: A positive integer representing how many nutrition points the item provides to villagers.
- Template:Nbt: If present, Minecraft:villagers will be able to pick up and eat the item.
Example: Template:Command
- Gives a Minecraft:golden apple that provides villagers with enough nutrition to breed all by itself.
waxed
- Template:Nbt: Parent tag.
- Template:Nbt: If present, the block's contents are Minecraft:waxed. Does not apply to blocks with separate waxed variants; for those, use the appropriate [[Minecraft:Data component format#block state|Template:Cd]] instead.
Example: Template:Command
- Gives an oak Minecraft:sign with the text "Hello there!" waxed in place.
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.
cushion/color
- Template:Nbt: Parent tag.
- Template:Nbt: The dye color of the Minecraft:cushion.
Example: Template:Cmd
- Gives a red Minecraft:cushion item that spawns a purple cushion entity.
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
- Template:Nbt: Parent tag.
- Template:Nbt: Template:Json ref — The variant of the Minecraft:painting. If present on an item, the item's tooltip will display: the painting's name (in yellow), the artist's name (in gray), and the painting's width & height in blocks (in white). Not all paintings have an artist attributed to them. If a painting item is in the Minecraft:creative inventory screen and this component is not present, a gray line of text that says "Random variant" is added to the tooltip instead.
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:ru:Формат компонента данных Minecraft:uk:Формат компонента даних Minecraft:zh:数据组件