Data component format
Data components, or simply components, are structured data used to store information and define behavior. Their IDs are namespaced identifiers, and their values can be any data type – see § List of components.
When used by 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 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 Java Edition hardcoded item properties.
Data components are only partly implemented for block entities. They partially replace the 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, but they still strictly use the NBT format and other older internal systems to store their data in memory, not data components.
Usage
[edit | edit source]Command format
[edit | edit source]Data components can be used in the item_stack and item_predicate argument types.
In commands that take an item_stack argument, such as /give, items are represented in the format item_id[component1=value,component2=value], with component being the 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 /clear and /execute if items, 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 data component predicate. See item_predicate for details.
Item format
[edit | edit source]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 NBT format, items are written as a compound with the following tags:
- [NBT Compound / JSON Object] The root tag.
- [String] id: The identifier of the item. Must not be
minecraft:air. - [Int] count: Number of items stacked in this inventory slot. Any item can be stacked, even if unstackable through normal means. Defaults to 1 if not specified. Valid range is 1 to 99.
- [NBT Compound / JSON Object] components: Optional map of additional (non-default) data components.
- See the list of components below.
- [String] id: The identifier 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 [Byte] Slot 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
[edit | edit source]Block entities are stored in the 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.
- [NBT Compound / JSON Object] The root tag.
- [String] id: Block entity ID
- [Boolean] keepPacked: 1 or 0 (
true/false) - Iftrue, this is an invalid block entity, and this block is not immediately placed when a loaded chunk is loaded. Iffalse, this is a normal block entity that can be immediately placed. - [Int] x: X coordinate of the block entity.
- [Int] y: Y coordinate of the block entity.
- [Int] z: Z coordinate of the block entity.
- [NBT Compound / JSON Object] components: Optional map of data components that are not represented by additional fields.
- Additional tags depending on the block entity ID. See 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
[edit | edit source]
attack_animation
attack_range
attribute_modifiers
banner_patterns
base_color
bees
block_entity _data
block_state
block_transformer
blocks_attacks
break_sound
brewing_fuel
bucket_entity _data
bundle_contents
can_break
can_place _on
charged_projectiles
compostable
consumable
container
container_loot
cooking_fuel
custom_data
custom_model _data
custom_name
damage
damage_resistant
damage_type
death_protection
debug_stick _state
dye
dyed_color
enchantable
enchantment_glint _override
enchantments
entity_data
equippable
firework_explosion
fireworks
food
glider
instrument
intangible_projectile
interact_animation
item_model
item_name
jukebox_playable
kinetic_weapon
lock
lodestone_tracker
lore
map_decorations
map_id
max_damage
max_stack _size
minimum_attack _charge
mob_visibility
note_block _sound
ominous_bottle _amplifier
piercing_weapon
pot_decorations
potion_contents
potion_duration _scale
profile
provides_banner _patterns
provides_pottery _pattern
provides_trim _material
rarity
recipes
repair_cost
repairable
sign_text _back
sign_text _front
stored_enchantments
sulfur_cube _content
suspicious_stew _effects
tool
tooltip_display
tooltip_style
trim
unbreakable
use_cooldown
use_effects
use_remainder
villager_food
waxed
weapon
writable_book _content
written_book _content
attack_animation
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:attack_animation: The swing animation to play when the item is used to attack something
- [String] type: The animation type. Can be
whack,stabornone. Defaults towhack. - [Int] duration: A positive integer that determines the animation's duration in ticks. Defaults to 6 game ticks (0.3 seconds).
- [String] type: The animation type. Can be
- [NBT Compound / JSON Object] minecraft:attack_animation: The swing animation to play when the item is used to attack something
attack_range
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:attack_range: Determines the attack range and hitbox margin of a weapon.
- [Float] min_reach: 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.
- [Float] max_reach: 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.
- [Float] min_creative_reach: The minimum distance in blocks from the attacker to the target to be considered valid in Creative mode. Defaults to 0.0, valid from 0.0 to 64.0.
- [Float] max_creative_reach: 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.
- [Float] hitbox_margin: 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.
- [Float] mob_factor: The multiplier applied to
min_rangeandmax_rangewhen checking for valid distance if item is used by a mob. Defaults to 1.0, valid from 0.0 to 2.0.
- [NBT Compound / JSON Object] minecraft:attack_range: Determines the attack range and hitbox margin of a weapon.
Example: /give @s diamond[attack_range={max_reach:5.0}]
- Gives a diamond that has an attack range of 5 blocks.
attribute_modifiers
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:attribute_modifiers: A list of attribute modifiers which, if present on an item, may be applied to a player or mob that has equipped the item. If the item is not in the correct equipment slot, it has no effect. The modifiers are removed from the entity once the item is moved out of that slot or is deleted. Any attribute modifiers specified are listed in the item's tooltip (unless hidden).
- [NBT Compound / JSON Object]: A single attribute modifier and its tooltip display type.
- [String] id: A namespaced ID to identify this modifier. It must be unique from other modifiers of the same attribute.
- [String] type: The namespaced ID of the attribute this modifier is to act upon.
- [String] slot: The equipment slot/slots the item must be in for the modifier to take effect. Can be
any,hand,armor,mainhand,offhand,head,chest,legs,feet,body, orsaddle. Defaults toany. Note:anyrefers to any equipment slot, not any inventory slot. - [String] operation: Modifier operation. Can be
add_value,add_multiplied_base, oradd_multiplied_total. See Attribute Modifiers for info. - [Double] amount: The value used in the modifier's operation.
- [NBT Compound / JSON Object] display: How the modifier is displayed in an item's tooltip. Optional.
- [String] type: Display type. Can be
default,hiddenoroverride. - [NBT Compound / JSON Object][NBT List / JSON Array][String] value (only present if [String] type is
override): A text component to show for this attribute modifier entry.
- [String] type: Display type. Can be
- [NBT Compound / JSON Object]: A single attribute modifier and its tooltip display type.
- [NBT List / JSON Array] minecraft:attribute_modifiers: A list of attribute modifiers which, if present on an item, may be applied to a player or mob that has equipped the item. If the item is not in the correct equipment slot, it has no effect. The modifiers are removed from the entity once the item is moved out of that slot or is deleted. Any attribute modifiers specified are listed in the item's tooltip (unless hidden).
Example: /give @s stick[attribute_modifiers=[{type:"minecraft:scale",slot:"hand",id:"example:grow",amount:4,operation:"add_multiplied_base"}]]
- Gives a stick that causes the player to grow 4x when holding it.
banner_patterns
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:banner_patterns: List of all patterns applied to the banner or the shield. If used on a shield and the
minecraft:base_colorcomponent is not specified, then white is used as the base banner color.- [NBT Compound / JSON Object]: A single pattern.
- [String] color: Dye color of the section.
- [String][NBT Compound / JSON Object] pattern: One banner pattern (an [String] ID, or a new [NBT Compound / JSON Object] banner pattern definition).
- A banner pattern see Template:Nbt inherit/banner pattern/template
- [NBT Compound / JSON Object]: A single pattern.
- [NBT List / JSON Array] minecraft:banner_patterns: List of all patterns applied to the banner or the shield. If used on a shield and the
Example: /give @s black_banner[banner_patterns=[{pattern:"triangle_top",color:"red"},{pattern:"cross",color:"white"}]]
- Gives a black banner with a red triangle and white cross pattern.
base_color
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:base_color: The base dye color of the banner applied on a shield. If neither this nor
minecraft:banner_patternsis specified, then the shield model will show its normal wooden texture. If theminecraft:banner_patternscomponent is specified but this component is not, then white is used as the base banner color. If present on a shield item, the item name is overridden as "<color> Shield" (e.g. if set togreen, the name will be "Green Shield").
- [String] minecraft:base_color: The base dye color of the banner applied on a shield. If neither this nor
Example: /give @s shield[base_color="lime"]
- Gives a lime shield.
bees
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:bees: A list of the entities currently in the beehive or bee nest. If present on an item, text is added to the item's tooltip that says how many entries are in the list (e.g. if there are two entries, the tooltip will say "Bees: 2 / 3") and each item is considered a full stack for the
minecraft:bundle_contentscomponents. Despite the tooltip suggesting there is a maximum of 3 entries, there is no limit to the size of this component.- [NBT Compound / JSON Object]: A single entity.
- [NBT Compound / JSON Object] entity_data: Must include
idtag. If theidis notminecraft:beethen the entity will never leave the hive. ThePassengers,Pos,Rotation, andUUIDtags are ignored when the bee spawns (the bee will always spawn in front of the hive with a random UUID, facing south, and without any passengers).- See Entity format.
- [Int] min_ticks_in_hive: The minimum amount of time in ticks for this entity to stay in the hive.
- [Int] ticks_in_hive: The amount of ticks the entity has stayed in the hive.
- [NBT Compound / JSON Object] entity_data: Must include
- [NBT Compound / JSON Object]: A single entity.
- [NBT List / JSON Array] minecraft:bees: A list of the entities currently in the beehive or bee nest. If present on an item, text is added to the item's tooltip that says how many entries are in the list (e.g. if there are two entries, the tooltip will say "Bees: 2 / 3") and each item is considered a full stack for the
Example: /give @s bee_nest[bees=[{entity_data:{id:"bee",CustomName:"Maya"},min_ticks_in_hive:60,ticks_in_hive:0}]]
- Gives a bee nest containing a single bee named Maya, which exits the bee nest in 3 seconds.
block_entity_data
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:block_entity_data: Block entity NBT applied when this block is placed. Depending on the block type that this item places, and the block entity ID specified in this component, this component may add a red message to the item's tooltip (for operator players only) warning the player that placing it may result in command execution.
- See Block entity format. Must include
idtag. Excludesx,y,z,componentsandkeepPackedtags.
- See Block entity format. Must include
- [NBT Compound / JSON Object] minecraft:block_entity_data: Block entity NBT applied when this block is placed. Depending on the block type that this item places, and the block entity ID specified in this component, this component may add a red message to the item's tooltip (for operator players only) warning the player that placing it may result in command execution.
Example: /give @s spawner[block_entity_data={id:"mob_spawner",SpawnData:{entity:{id:"spider"}}}]* Gives a spider spawner. Placing this spawner requires the player to have operator permissions.
block_state
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:block_state: The block state properties to apply when placing this block. When present on an item, regardless of the item type, if the
honey_levelproperty is specified then a gray "Honey:<honey_level>/ 5" text is added to the tooltip.- [String] <block state>: A key-value pair, where the key is a block state key and the value is a block state value to force place for this block, for example
facing: "east".
- [String] <block state>: A key-value pair, where the key is a block state key and the value is a block state value to force place for this block, for example
- [NBT Compound / JSON Object] minecraft:block_state: The block state properties to apply when placing this block. When present on an item, regardless of the item type, if the
Example: /give @s bamboo_slab[block_state={type:"top"}]
- Gives a bamboo slab that is always placed in the top half of the block.
block_transformer
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:block_transformer: One block transformer (an [String] ID). Define the item's usage within a block. Some blocks have usage that depends on the block, having priority (see interactable blocks), and some items have hardcoded usage.
Example: /give @s blaze_rod[minecraft:block_transformer="shovel"]
- Gives a blaze rod which can create dirt paths as a shovel can.
blocks_attacks
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:blocks_attacks: When present, this item can be used like a shield to block attacks to the holding player.
- [Float] block_delay_seconds: The amount of time (in seconds) that use must be held before successfully blocking attacks. Defaults to
0. - [Float] disable_cooldown_scale: The multiplier applied to the cooldown time for the item when attacked by a disabling attack (the multiplier for [Float] disable_blocking_for_seconds on the
minecraft:weaponcomponent). If set to0, this item can never be disabled by attacks. Defaults to1. - [NBT List / JSON Array] damage_reductions: 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.- [NBT Compound / JSON Object]: A damage reduction field
- [String][NBT List / JSON Array] type: Any number of damage type(s) (an [String] ID, or a [String] tag with
#, or an [NBT List / JSON Array] array containing [String] IDs) to block. Defaults to all damage types. - [Float] base: The constant amount of damage to be blocked. This is a required field.
- [Float] factor: The fraction of the dealt damage to be blocked. This is a required field.
- [Float] horizontal_blocking_angle: strictly positive float — The maximum angle between the users facing direction and the direction of the incoming attack to be blocked. Defaults to
90.
- [String][NBT List / JSON Array] type: Any number of damage type(s) (an [String] ID, or a [String] tag with
- [NBT Compound / JSON Object]: A damage reduction field
- [NBT Compound / JSON Object] item_damage: Controls how much damage should be applied to the item from a given attack.
- [Float] threshold: The minimum amount of damage dealt by the attack before item damage is applied to the item. Defaults to
0. - [Float] base: The constant amount of damage applied to the item, if threshold is passed. Defaults to
0. - [Float] factor: The fraction of the dealt damage that should be applied to the item, if threshold is passed. Defaults to
1.5.
- [Float] threshold: The minimum amount of damage dealt by the attack before item damage is applied to the item. Defaults to
- [String][NBT Compound / JSON Object] block_sound: One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition) to play when an attack is successfully blocked. Defaults to none.
- A sound event see Template:Nbt inherit/sound event/template
- [String][NBT Compound / JSON Object] disabled_sound: One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition) to play when the item goes on its disabled cooldown due to an attack. Defaults to none.
- A sound event see Template:Nbt inherit/sound event/template
- [String] bypassed_by: a damage type tag with
#of damage types that bypass the blocking. Defaults to none.
- [Float] block_delay_seconds: The amount of time (in seconds) that use must be held before successfully blocking attacks. Defaults to
- [NBT Compound / JSON Object] minecraft:blocks_attacks: When present, this item can be used like a shield to block attacks to the holding player.
Example: /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.
break_sound
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT Compound / JSON Object] minecraft:break_sound: One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition) to play when the item runs out of durability and breaks.
- A sound event see Template:Nbt inherit/sound event/template
- [String][NBT Compound / JSON Object] minecraft:break_sound: One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition) to play when the item runs out of durability and breaks.
Example: /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.
brewing_fuel
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:brewing_fuel: If present, this item can be consumed for fuel by brewing stands.
- [Float][String] uses: How many infusions will be fueled by destroying this item. Either a fixed number or the namespaced ID of a number provider, which is evaluated using the
container_processloot context when a brewing stand uses this item as fuel. The resolved value is rounded to the nearest whole number. The fuel item is consumed regardless of whether the result is a positive number. - [Float][String] speed_multiplier: How quickly infusions should brew during the time provided by this fuel item. Either a fixed number or the namespaced ID of a number provider, which is evaluated using the
container_processloot context when a brewing stand uses this item as fuel. If the resolved value is0.0or less, it is treated as1.0. Each infusion that starts while this fuel is active will takeceil(400 ÷ mult)ticks, meaning higher values brew quicker and lower values brew slower. The provider is only evaluated once when the fuel is consumed, and the scaled brewing time is only calculated once when the infusion begins.
- [Float][String] uses: How many infusions will be fueled by destroying this item. Either a fixed number or the namespaced ID of a number provider, which is evaluated using the
- [NBT Compound / JSON Object] minecraft:brewing_fuel: If present, this item can be consumed for fuel by brewing stands.
Example: /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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:bucket_entity_data: NBT applied to an entity when placed from this bucket. Only tags below are applied.
- [Boolean] NoAI: Turns into
NoAIentity tag for all bucketable entities. - [Boolean] Silent: Turns into
Silententity tag for all bucketable entities. - [Boolean] NoGravity: Turns into
NoGravityentity tag for all bucketable entities. - [Boolean] Glowing: Turns into
Glowingentity tag for all bucketable entities. - [Boolean] Invulnerable: Turns into
Invulnerableentity tag for all bucketable entities. - [Boolean] AgeLocked: Turns into
AgeLockedentity tag for axolotls and tadpoles. - [Float] Health: Turns into
Healthentity tag for all bucketable entities. - [Int] Age: Turns into
Ageentity tag for axolotls and tadpoles. - [Long] HuntingCooldown: Turns into the expiry time of the memory module
has_hunting_cooldownfor axolotls.
- [Boolean] NoAI: Turns into
- [NBT Compound / JSON Object] minecraft:bucket_entity_data: NBT applied to an entity when placed from this bucket. Only tags below are applied.
Other tags such as the entity's name or variant are stored as separate item components such as minecraft:custom_name and minecraft:tropical_fish/pattern.
Example: /give @s axolotl_bucket[bucket_entity_data={Health:3.0f},axolotl/variant="wild",custom_name="Bob"]
- Gives a bucket of axolotl that has 3 health, the Wild type, and is named "Bob".
bundle_contents
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:bundle_contents: The items stored inside this 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 bundle, it cannot be used by the player and the usual instruction and fullness bar does not appear in the tooltip.
- [NBT Compound / JSON Object]: A single item stack.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object]: A single item stack.
- [NBT List / JSON Array] minecraft:bundle_contents: The items stored inside this 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 bundle, it cannot be used by the player and the usual instruction and fullness bar does not appear in the tooltip.
Example: /give @s bundle[bundle_contents=[{id:"diamond",count:2}]]
- Gives a bundle containing exactly 2 diamonds.
can_break
[edit | edit source]When present, the player holding the item can break the specified blocks in Adventure mode.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object][NBT List / JSON Array] minecraft:can_break: The only blocks this item may break when used by a player in Adventure mode. If defined as a compound, corresponds to [NBT Compound / JSON Object] A single block predicate. Items are listed in the tooltip in the order specified.
- [NBT Compound / JSON Object]: A single block predicate. If no fields are specified, any block will match.
- [NBT List / JSON Array][String] blocks: (Optional) Any number of block type(s) (an [String] ID, or a [String] tag with
#, or an [NBT List / JSON Array] array containing [String] IDs). Test fails if the block is not a matching block type. - [NBT Compound / JSON Object] state: (Optional) Tests the block state. Test fails if the block doesn't have matching block state properties.
- [String] <key>: Property key and value.
- [NBT Compound / JSON Object] <key>: Property key and value range. If neither [String] min nor [String] max is specified, any value will match.
- [String] min: (Optional) Minimum value. Despite being represented as a string, comparison is done using the property's actual type. Integers use numeric order, and booleans order
falsebeforetrue. - [String] max: (Optional) Maximum value.
- [String] min: (Optional) Minimum value. Despite being represented as a string, comparison is done using the property's actual type. Integers use numeric order, and booleans order
- [NBT Compound / JSON Object][String] nbt: (Optional) An NBT compound, represented either as an object or a string containing SNBT. In JSON files, SNBT form is the only way to test for some NBT types. Test fails if the block doesn't have matching NBT data.
- [NBT Compound / JSON Object] components: (Optional) Data components to match exactly. Each key in this object is a component ID, and its value is a full component of that type. Test fails if the block doesn't have exactly the same value for every provided component.
- [NBT Compound / JSON Object] predicates: (Optional) Data component predicates to match components loosely. Each key in this object is a component predicate ID, and its value is a component predicate of that type. Test fails if the block's components do not match all predicates.
- [NBT List / JSON Array][String] blocks: (Optional) Any number of block type(s) (an [String] ID, or a [String] tag with
- [NBT Compound / JSON Object]: A single block predicate. If no fields are specified, any block will match.
- [NBT Compound / JSON Object][NBT List / JSON Array] minecraft:can_break: The only blocks this item may break when used by a player in Adventure mode. If defined as a compound, corresponds to [NBT Compound / JSON Object] A single block predicate. Items are listed in the tooltip in the order specified.
Example: /give @s netherite_pickaxe[can_break={blocks:['black_concrete','coal_ore','iron_ore','gold_ore','diamond_ore','emerald_ore']}]
- Gives a netherite pickaxe that can only mine some ores, as well as black concrete.
can_place_on
[edit | edit source]When present, the player holding the item can place the held block item on any sides of the specified blocks in Adventure mode.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object][NBT List / JSON Array] minecraft:can_place_on: Determines which blocks that blocks with this component can be placed against in Adventure mode. If defined as a compound, corresponds to [NBT Compound / JSON Object] A single block predicate. Items are listed in the tooltip in the order specified (when viewed in inventory).
- [NBT Compound / JSON Object]: A single block predicate. If no fields are specified, any block will match.
- [NBT List / JSON Array][String] blocks: (Optional) Any number of block type(s) (an [String] ID, or a [String] tag with
#, or an [NBT List / JSON Array] array containing [String] IDs). Test fails if the block is not a matching block type. - [NBT Compound / JSON Object] state: (Optional) Tests the block state. Test fails if the block doesn't have matching block state properties.
- [String] <key>: Property key and value.
- [NBT Compound / JSON Object] <key>: Property key and value range. If neither [String] min nor [String] max is specified, any value will match.
- [String] min: (Optional) Minimum value. Despite being represented as a string, comparison is done using the property's actual type. Integers use numeric order, and booleans order
falsebeforetrue. - [String] max: (Optional) Maximum value.
- [String] min: (Optional) Minimum value. Despite being represented as a string, comparison is done using the property's actual type. Integers use numeric order, and booleans order
- [NBT Compound / JSON Object][String] nbt: (Optional) An NBT compound, represented either as an object or a string containing SNBT. In JSON files, SNBT form is the only way to test for some NBT types. Test fails if the block doesn't have matching NBT data.
- [NBT Compound / JSON Object] components: (Optional) Data components to match exactly. Each key in this object is a component ID, and its value is a full component of that type. Test fails if the block doesn't have exactly the same value for every provided component.
- [NBT Compound / JSON Object] predicates: (Optional) Data component predicates to match components loosely. Each key in this object is a component predicate ID, and its value is a component predicate of that type. Test fails if the block's components do not match all predicates.
- [NBT List / JSON Array][String] blocks: (Optional) Any number of block type(s) (an [String] ID, or a [String] tag with
- [NBT Compound / JSON Object]: A single block predicate. If no fields are specified, any block will match.
- [NBT Compound / JSON Object][NBT List / JSON Array] minecraft:can_place_on: Determines which blocks that blocks with this component can be placed against in Adventure mode. If defined as a compound, corresponds to [NBT Compound / JSON Object] A single block predicate. Items are listed in the tooltip in the order specified (when viewed in inventory).
Example: /give @s target[can_place_on={blocks:'sandstone'}]
- Gives a target block that can only be placed on sandstone.
charged_projectiles
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:charged_projectiles: The items loaded as projectiles into this crossbow. If there are item stacks in this component, the item name for item stack is listed in the tooltip of the item as "Projectile: [
<name>]", and any duplicate item stack entries are grouped together as "Projectile:Nx [<name>]". If not present, this crossbow is not charged.- [NBT Compound / JSON Object]: A single projectile item stack.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object]: A single projectile item stack.
- [NBT List / JSON Array] minecraft:charged_projectiles: The items loaded as projectiles into this crossbow. If there are item stacks in this component, the item name for item stack is listed in the tooltip of the item as "Projectile: [
Example: /give @s crossbow[charged_projectiles=[{id:"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.
compostable
[edit | edit source]If present, the item can be used on composters, regardless of the value returned by [Float][String] layers:
- If the initial level of the composter is less than
7, the item is consumed and produces a sound and particle. - If the level is
7, the item is not consumed, but maintains the use animation. Items without this component cannot be used. - If the level is
8, as with any other item, when used it is not consumed and collects the bone meal.
Additionally, items with this component can by placed in a non-full composter (level less than 7) by hoppers, minecarts with hoppers, and dispensers. Farmers will only use wheat seeds and beetroot seeds on composters, but the behavior when they do is controlled by this component.
Vanilla items that are guaranteed to add a compost layer use a number provider that always returns 1. Vanilla items that have a random chance of adding a compost layer use number providers that return 1 if the composter is completely empty, and randomly select between 0 and 1 with the appropriate probability if it is not.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:compostable:
- [Float][String] layers: Required. The number of compost layers added when using this item on a non-full composter (
levelless than 7). Either a fixed number or the namespaced ID of a number provider, which is evaluated using theblock_interactloot context when the item is used. The optional block entity and tool loot context parameters are not supplied. The resolved value is rounded to the nearest whole number, and negative values are treated as0. The final compost level after the new layers are added is clamped to the range 0–7.
- [Float][String] layers: Required. The number of compost layers added when using this item on a non-full composter (
- [NBT Compound / JSON Object] minecraft:compostable:
consumable
[edit | edit source]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
food,potion_contents,ominous_bottle_amplifierorsuspicious_stew_effectscomponents are also present on this item, consuming it applies the stats and effects of those components. - If the
foodcomponent are also present on this item, foxes consider the item as consumable food.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:consumable: If present, this item can be consumed on use.
- [Float] consume_seconds: The amount of seconds it takes for a player to consume the item. Defaults to 1.6.
- [String] animation: The animation used during consumption of the item. Must be one of
none,eat,drink,block,bow,spear,crossbow,spyglass,toot_horn,brush,bundle, ortrident. Defaults toeat. - [String][NBT Compound / JSON Object] sound: Optional[upcoming: JE 26.4]; One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition) used during and on completion of the item's consumption. Defaults to
entity.generic.eat.- A sound event see Template:Nbt inherit/sound event/template
- [Boolean] has_consume_particles: Whether consumption particles are emitted while consuming this item. Defaults to
true. - [NBT List / JSON Array] on_consume_effects: A list of effects which take place as a result of consuming this item. Optional.
- [NBT Compound / JSON Object]: A single consume effect.
- Consume effect see Template:Nbt inherit/consume effect/template
- [NBT Compound / JSON Object]: A single consume effect.
- [NBT Compound / JSON Object] minecraft:consumable: If present, this item can be consumed on use.
Example: /give @s gold_ingot[consumable={consume_seconds:3.0, animation:'eat', sound:'entity.generic.eat', has_consume_particles:true, on_consume_effects:[{type:'minecraft:clear_all_effects'}]}]
- Gives a gold ingot that can be eaten in 3 seconds and upon consuming, clears all effects.
container
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:container: The items contained in this container's slots. If present on an item, the first 5 item slots in the container are listed in the tooltip, and the number of any extra slots are listed as "and
<N>more..." underneath (only seen on shulker boxes in normal gameplay or ctrl-middle-clicked containers in creative mode). This component supports up to 256 item slots but, when present on some block entities, the number of slots may be artificially limited based on the number of slots the block needs (e.g. 1 for decorated pots, and 27 for chests).- [NBT Compound / JSON Object]: A single item.
- [NBT Compound / JSON Object] item: The item stack in this slot.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [Int] slot: A slot in this container. Can be from 0 to 255 (inclusive).
- [NBT Compound / JSON Object] item: The item stack in this slot.
- [NBT Compound / JSON Object]: A single item.
- [NBT List / JSON Array] minecraft:container: The items contained in this container's slots. If present on an item, the first 5 item slots in the container are listed in the tooltip, and the number of any extra slots are listed as "and
Example: /give @s barrel[container=[{slot:0,item:{id:apple}}]]
- Gives a barrel with an apple in the first slot.
container_loot
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:container_loot: The unresolved loot table and seed of this container item.
- [String] loot_table: The ID of a loot table.
- [Long] seed: The pseudorandom seed to resolve the loot table with. If not specified or 0, a seed is randomly chosen by the game.
- [NBT Compound / JSON Object] minecraft:container_loot: The unresolved loot table and seed of this container item.
Example: /give @s chest[container_loot={loot_table:"chests/desert_pyramid"}]
- Gives a chest that contains the desert pyramid loot when opened.
cooking_fuel
[edit | edit source]Controls whether an item can be used as smelting fuel and how effective a fuel it is.
All vanilla fuel items set the values in this component to number providers that give higher speed and lower burn time if the current block is a smoker or blast furnace, checked using the minecraft:block/fast_cooking predicate. If fuel that doesn't have this check is used, recipes for those blocks have the same speed and fuel efficiency as normal furnace recipes.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:cooking_fuel: If present, this item can be burned for smelting fuel.
- [Float][String] burn_time: How many ticks of fuel will be provided by destroying this item. Either a fixed number or the namespaced ID of a number provider, which is evaluated using the
container_processloot context when a furnace tries to use this item as fuel. The resolved value is rounded to the nearest whole number, and if the result is0, the item is not used as fuel on this tick. - [Float][String] speed_multiplier: How quickly items should smelt during the burn time provided by this fuel item. Either a fixed number or the namespaced ID of a number provider, which is evaluated using the
container_processloot context when a furnace uses this item as fuel. If the resolved value is0.0or less, it is treated as1.0. Each ingredient that starts cooking while this fuel is burning will takeceil(cookingtime ÷ mult)ticks to cook, where cookingtime is specified in the recipe, meaning higher values cook quicker and lower values cook slower. 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.
- [Float][String] burn_time: How many ticks of fuel will be provided by destroying this item. Either a fixed number or the namespaced ID of a number provider, which is evaluated using the
- [NBT Compound / JSON Object] minecraft:cooking_fuel: If present, this item can be burned for smelting fuel.
Example 1: /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.
Example 2: /give @s diorite[cooking_fuel={burn_time:40,speed_multiplier:2}]
- Gives a diorite block that burns for 40 ticks and speeds up the cooking time by a factor of 2.
custom_data
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT Compound / JSON Object] minecraft:custom_data: Contains key-value pairs of any custom data not used by the game, either as an object or a SNBT string.
- [Undefined] <key>: A key-value pair, where the value can have any data type, including another compound.
- [String][NBT Compound / JSON Object] minecraft:custom_data: Contains key-value pairs of any custom data not used by the game, either as an object or a SNBT string.
Example: /give @s iron_sword[custom_data={foo:1}]
- Gives an iron sword with custom data
{foo:1}.
custom_model_data
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:custom_model_data: A list of values used by items model definitions for model selection and coloring.
- [NBT List / JSON Array] floats: A list of [Float] floats for the
range_dispatchmodel type. Missing values return thefallbackmodel. - [Byte Array] flags: A list of [Boolean] booleans for the
conditionmodel type. Missing value returns theis_falsemodel. - [NBT List / JSON Array] strings: A list of [String] strings for the
selectmodel type. Missing value returns thefallbackmodel. - [NBT List / JSON Array][Int Array] colors: A list of RGB values for the
modelmodel type'stints. Missing values return thedefaultvalue provided by the item model definition. Each entry can either be a list of floats or an integer. Any provided lists automatically convert to an integer, so the component is saved as an int array.- [Int]: An RGB color code converted to a decimal number. It can be calculated from the Red, Green and Blue components using this formula:
Red<<16 + Green<<8 + BlueAn interactive widget is being loaded. If this does not work for you, please reload the page or check if JavaScript is working or enabled. - [NBT List / JSON Array]: A list containing 3 floats corresponding to red, green, and blue values as a fraction (ranged 0 to 1, inclusive). Automatically converted to the integer format when saved.
- [Int]: An RGB color code converted to a decimal number. It can be calculated from the Red, Green and Blue components using this formula:
- [NBT List / JSON Array] floats: A list of [Float] floats for the
- [NBT Compound / JSON Object] minecraft:custom_model_data: A list of values used by items model definitions for model selection and coloring.
Example:
/give @s bone[custom_model_data={floats:[4.0, 5.6, 99.1],strings:["foo:bar"],colors:[8323327, [0.5,0,1], 0x7F00FF]}]
- Gives a bone with custom model data. The
colorslist shows three possible representations of the same violet color.
custom_name
[edit | edit source]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, which specifies the default name of the item.
- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] minecraft:custom_name: The player-assigned name of this item, block, or entity, typically assigned with an anvil or a name tag. See 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 command block, this replaces the execution context name when the command is ran.
Example:
/give @s stick[custom_name={text:"Magic Wand",color:"light_purple",italic:false}]
- Gives a stick named "Magic Wand" in light purple non-italicized text.
damage
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:damage: The number of uses consumed (not remaining) of the item's 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
minecraft:max_damageis also present on the item, and the player hovering over the item has advanced tooltips on, then white text is added to the tooltip showing "Durability:<durability>/<max_damage>".
- [Int] minecraft:damage: The number of uses consumed (not remaining) of the item's 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
Example: /give @s diamond_axe[damage=500]
- Gives a diamond axe with 500 points of damage.
damage_resistant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:damage_resistant: If specified, this item is invulnerable to the specified damage types when in entity form or equipped.
- [String] types: A damage type tag prefixed with
#.
- [String] types: A damage type tag prefixed with
- [NBT Compound / JSON Object] minecraft:damage_resistant: If specified, this item is invulnerable to the specified damage types when in entity form or equipped.
Example: /give @s cake[damage_resistant={types:"#minecraft:is_fire"}]
- Gives a cake that is immune to all types of fire damage.
damage_type
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:damage_type: Specifies the damage type this item deals
Example: /give @s diamond_sword[damage_type="minecraft:campfire"]
- Gives a diamond sword that deals "campfire" type damage.
death_protection
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:death_protection: If present, this item protects the holder from dying by restoring a single health point.
- [NBT List / JSON Array] death_effects: A list of consume effects that are applied when the item protects the holder. Optional.
- [NBT Compound / JSON Object]: A single consume effect.
- Consume effect see Template:Nbt inherit/consume effect/template
- [NBT Compound / JSON Object]: A single consume effect.
- [NBT List / JSON Array] death_effects: A list of consume effects that are applied when the item protects the holder. Optional.
- [NBT Compound / JSON Object] minecraft:death_protection: If present, this item protects the holder from dying by restoring a single health point.
Example: /give @s nether_star[death_protection={death_effects:[{type:'minecraft:clear_all_effects'}]}]
- Gives a nether star that protects the holder from death and removes all status effects from the holder.
debug_stick_state
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:debug_stick_state: The selected block state properties used by this debug stick.
- [String] <block ID>: A key-value pair, where the key is a block ID and the value is a block state key to edit on the block, for example
"minecraft:oak_fence": "east".
- [String] <block ID>: A key-value pair, where the key is a block ID and the value is a block state key to edit on the block, for example
- [NBT Compound / JSON Object] minecraft:debug_stick_state: The selected block state properties used by this debug stick.
Example: /give @s debug_stick[debug_stick_state={"minecraft:oak_fence": "west", "minecraft:candle": "lit"}]
- Gives a debug stick with the oak fence block state property set to
westand the candle block state property set tolit.
dye
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:dye: When present on an item, stores the color of dye that this item can be used as for the purpose of crafting recipes and mob or block interactions. Can be one of
white,orange,magenta,light_blue,yellow,lime,pink,gray,light_gray,cyan,purple,blue,brown,green,red, orblack.
- [String] minecraft:dye: When present on an item, stores the color of dye that this item can be used as for the purpose of crafting recipes and mob or block interactions. Can be one of
Example: /give @s blue_dye[dye="red"]
- Gives a blue dye item that acts like a red dye.
dyed_color
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:dyed_color: The RGB color of the tint applied to a dyed item, typically as a result of combining the item with dyes in a
minecraft:crafting_dyedtype crafting recipe. More generally, this component is used as theminecraft:dyecolor provider in 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 advanced tooltips is off, or a non-italic "Color: #<hex color code>"[note 1] instead when advanced tooltips is on. The color is stored as an integer which packs the color's red, green and blue channels using this formula:([note 2]
Red << 16) + (
Green << 8) +
BlueAn interactive widget is being loaded. If this does not work for you, please reload the page or check if JavaScript is working or enabled. - [NBT List / JSON Array] minecraft:dyed_color: An alternative format. A list of 3 floats, ranging from 0.0 to 1.0 (inclusive)[note 3], 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 + (due to the alpha channel being implicitly set to 255, resulting in a negative integer.[note 4].
Red << 16) + (
Green << 8) +
Blue
- [Int] minecraft:dyed_color: The RGB color of the tint applied to a dyed item, typically as a result of combining the item with dyes in a
Example: /give @s leather_helmet[dyed_color=8388403]
or: /give @s leather_helmet[dyed_color=0x7FFF33]
or: /give @s leather_helmet[dyed_color=[0.5, 1.0, 0.2]]
- Gives a blueish-green leather helmet.
enchantable
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:enchantable: If this and
minecraft:enchantmentsare present on an item, and applicable enchantments are available, the item can be enchanted in an enchanting table.- [Int] value: Positive integer representing the item's enchantability. A higher value allows enchantments with a higher cost to be picked.
- [NBT Compound / JSON Object] minecraft:enchantable: If this and
Example: /give @s elytra[enchantable={value:15}]
- Gives a pair of elytra that can be enchanted in an enchanting table with an enchantability of 15.
enchantment_glint_override
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Boolean] minecraft:enchantment_glint_override: Overrides the enchantment glint effect on this item. When
true, this item displays a glint, even without enchantments. Whenfalse, this item does not display a glint, even with enchantments.
- [Boolean] minecraft:enchantment_glint_override: Overrides the enchantment glint effect on this item. When
Example: /give @s experience_bottle[enchantment_glint_override=false]
- Gives an experience bottle without the visual enchantment glint, which is otherwise applied by default.
enchantments
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:enchantments: Contains a map of each of this item's enchantments to its enchantment level. This and
minecraft:enchantablemust exist on an item for it to be able to be enchanted in an enchanting table. If present on an item, the color of the item name is aqua if its rarity iscommonoruncommon, and light purple if its rarity israreorepic. 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.- [Int] <enchantment ID>: A single key-value pair, where the key is the identifier of an enchantment, and the value is the level.
- [NBT Compound / JSON Object] minecraft:enchantments: Contains a map of each of this item's enchantments to its enchantment level. This and
Example: /give @s wooden_sword[enchantments={sharpness:3,knockback:2}]
- Gives a wooden sword with Sharpness III and Knockback II.
Note: This component adds active enchantments and should not be confused with the stored_enchantments component, which is used to add inactive enchantments, such as with enchanted books.
To illustrate the difference, hitting an entity with an enchanted_book[enchantments={knockback:2}] would knock any entity hit per knockback II while hitting an entity with an enchanted_book[stored_enchantments={knockback:2}] 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:entity_data: NBT applied to an entity when created from an item.
- [String] id: The identifier of the entity. If the item is a spawn egg and this id is
falling_block,command_block_minecart, orspawner_minecart, this component adds a red message to the item's tooltip (for operator players only) warning the player that using it may result in command execution. Define the generating entity by spawn egg. For other items, it must be equal to the id of the entity generated by the item; otherwise, the component is not effective. - [Undefined] <any field>: Optional. See Entity format for effective fields, excludes
id,UUIDandPassengers. Applies the NBT tag to the entity if it is valid and applicable. Other fields can be added, but they have no effect.
- [String] id: The identifier of the entity. If the item is a spawn egg and this id is
- [NBT Compound / JSON Object] minecraft:entity_data: NBT applied to an entity when created from an item.
Example: /give @s armor_stand[entity_data={id:"armor_stand",Small:1b}]
- Gives an armor stand that is small when placed down.
equippable
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:equippable: If present, this item can be equipped in the specified slot.
- [String] slot: The slot to put the item on. Can be one of
head,chest,legs,feet,body,mainhand,offhand, orsaddle - [String][NBT Compound / JSON Object] equip_sound: Optional[upcoming: JE 26.4]; One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition) to play when the item is equipped. Defaults to
item.armor.equip_generic.- A sound event see Template:Nbt inherit/sound event/template
- [String] asset_id: The identifier of the 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). - [String][NBT List / JSON Array] allowed_entities: Entity ID, Entity Tag, or list of Entity IDs to limit which entities can equip this item. Defaults to all entities.
- [Boolean] dispensable: Whether the item can be dispensed by using a dispenser.[note 5] Defaults to
true. - [Boolean] swappable: Whether the item can be equipped into the relevant slot by right-clicking. Defaults to
true. - [Boolean] damage_on_hurt: Whether this item is damaged when the wearing entity is damaged. Defaults to
true. - [Boolean] equip_on_interact: Whether this item can be equipped onto a target mob by pressing use on it (as long as this item can be equipped on the target at all). Defaults to
false. - [String] camera_overlay: The identifier 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 missing texture, rather than falling back to a default such as the pumpkin overlay. - [Boolean] can_be_sheared: Whether this item can be unequipped from a target mob by right-clicking with Shears. See here for more details. Defaults to
false. - [String][NBT Compound / JSON Object] shearing_sound: Optional[upcoming: JE 26.4]; One server-side sound event (an [String] ID, or a new [NBT Compound / JSON Object] server-side sound event definition) to play when the item is sheared. Defaults to
item.shears.snip.- A sound event see Template:Nbt inherit/sound event/template
- [String] slot: The slot to put the item on. Can be one of
- [NBT Compound / JSON Object] minecraft:equippable: If present, this item can be equipped in the specified slot.
Example 1: /give @s glass[equippable={slot:"head",equip_sound:"block.glass.break",dispensable:true}]
- Gives a glass block that can be equipped in the helmet slot.
Example 2: /give @s leather_leggings[equippable={slot:legs,asset_id:"minecraft:diamond"}]
- Gives a pair of leather pants that appear as diamond leggings when worn.
firework_explosion
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:firework_explosion: The explosion effect stored by this firework star.
- [String] shape: The shape of the explosion. Can be
small_ball,large_ball,star,creeper, orburst. - [NBT List / JSON Array] colors: The colors of the initial particles of the explosion, randomly selected from.
- [Int] A color as a packed integer
- [NBT List / JSON Array] fade_colors: The colors of the fading particles of the explosion, randomly selected from.
- [Int] A color as a packed integer
- [Boolean] has_trail: Whether or not the explosion has a trail effect (diamond).
- [Boolean] has_twinkle: Whether or not the explosion has a twinkle effect (glowstone dust).
- [String] shape: The shape of the explosion. Can be
- [NBT Compound / JSON Object] minecraft:firework_explosion: The explosion effect stored by this firework star.
fireworks
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:fireworks
- [Byte] flight_duration: The flight duration of this firework rocket (and the number of gunpowders used to craft it). Must be an integer between -128 and 127. Defaults to 1. If specified, gray "Flight Duration:
<flight_duration>" text is added to the item's tooltip. - [NBT List / JSON Array] explosions: List of the explosion effects caused by this firework rocket. Has a maximum of 256 explosions. Each explosion is listed in the item's tooltip as its shape on the first line, then additional information such as color indented on further lines.
- [NBT Compound / JSON Object]: A single explosion effect.
- [String] shape: The shape of the explosion. Can be
small_ball,large_ball,star,creeper, orburst. - [NBT List / JSON Array] colors: The colors of the initial particles of the explosion, randomly selected from.
- [Int][NBT List / JSON Array] A color as a packed integer or list of three floats.
- [NBT List / JSON Array] fade_colors: The colors of the fading particles of the explosion, randomly selected from.
- [Int][NBT List / JSON Array] A color as a packed integer or list of three floats.
- [Boolean] has_trail: Whether or not the explosion has a trail effect (diamond).
- [Boolean] has_twinkle: Whether or not the explosion has a twinkle effect (glowstone dust).
- [String] shape: The shape of the explosion. Can be
- [NBT Compound / JSON Object]: A single explosion effect.
- [Byte] flight_duration: The flight duration of this firework rocket (and the number of gunpowders used to craft it). Must be an integer between -128 and 127. Defaults to 1. If specified, gray "Flight Duration:
- [NBT Compound / JSON Object] minecraft:fireworks
food
[edit | edit source]If present and the consumable component are also present on this item, foxes consider the item as consumable food.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:food: The food stats applied to the mob or player upon consuming this item.
- [Int] nutrition: The number of food points restored by this item when the player eats. The number of health points restored by this item when used to feed cats. Wolfs, nautilus and zombie nautilus restored the twice the value. Must be a non-negative integer.
- [Float] saturation: The amount of saturation restored by this item when eaten.
- [Boolean] can_always_eat: If
true, this item can be eaten even if the player is not hungry. Defaults tofalse.
- [NBT Compound / JSON Object] minecraft:food: The food stats applied to the mob or player upon consuming this item.
Example 1: /give @s melon_slice[food={nutrition:3,saturation:1,can_always_eat:true}]
- Gives a melon slice that can be eaten at any time and restores 3 food points and 1 saturation.
Example 2: /give @s minecraft:sponge[consumable={consume_seconds:2.4},food={nutrition:5,saturation:5,can_always_eat:true}]
- 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:glider: If present, this item allows living entities to glide (as with elytra) when equipped. If the item is damageable, it will only allow entities to glide if it has
minecraft:damage<minecraft:max_damage− 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.
- [NBT Compound / JSON Object] minecraft:glider: If present, this item allows living entities to glide (as with elytra) when equipped. If the item is damageable, it will only allow entities to glide if it has
Example: /give @s nether_star[equippable={slot:"head"},glider={}]
- 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT Compound / JSON Object] minecraft:instrument: One instrument (an [String] ID, or a new [NBT Compound / JSON Object] instrument definition). If present on an item, the description of the instrument is shown in the item's tooltip as gray text.
- An instrument see Template:Nbt inherit/instrument/template
- [String][NBT Compound / JSON Object] minecraft:instrument: One instrument (an [String] ID, or a new [NBT Compound / JSON Object] instrument definition). If present on an item, the description of the instrument is shown in the item's tooltip as gray text.
Example 1: /give @s goat_horn[instrument="feel_goat_horn"]
- Gives a goat horn that uses the Feel instrument.
Example 2: /give @s goat_horn[instrument={description: "prank!", sound_event: "entity.creeper.primed", use_duration:2, range:30}]
- Gives a goat horn that plays the entity.creeper.primed sound.
intangible_projectile
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:intangible_projectile: If present on an item that can be used as a projectile without breaking upon impact (such as arrows and tridents), the projectile cannot be picked up by a player once fired, unless they are in creative mode. When present on any item, a line of gray text that says "Intangible" is added to the item's tooltip.
Example: /give @s arrow[intangible_projectile={}]
- Gives an arrow that cannot be picked up by players in Survival mode.
interact_animation
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:interact_animation: The swing animation to play when the item is used to interact with something.
- [String] type: The animation type. Can be
whack,stabornone. Defaults towhack. - [Int] duration: A positive integer that determines the animation's duration in ticks. Defaults to 6 game ticks (0.3 seconds).
- [String] type: The animation type. Can be
- [NBT Compound / JSON Object] minecraft:interact_animation: The swing animation to play when the item is used to interact with something.
item_model
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:item_model: The identifier of an item model definition. Referencing nonexistent models will cause the missing model to be used.
Example: /give @s netherite_sword[item_model="minecraft:diamond_sword"]
- Gives a netherite sword that looks like a diamond sword.
item_name
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] minecraft:item_name: The default name of this item, as a text component, present on all items by default. Unlike the
minecraft:custom_namecomponent, 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.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] minecraft:item_name: The default name of this item, as a text component, present on all items by default. Unlike the
Example: /give @s diamond[minecraft:item_name="Dirt"]
- Gives a diamond that is named "Dirt".
jukebox_playable
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:jukebox_playable: One jukebox song (an [String] ID) to play when inserted into a jukebox. If present on an item, the item can be inserted into a jukebox to play the specified song. If present on an item, the artist and the title of the song are added to the item's tooltip as gray text.
Example: /give @s diamond[minecraft:jukebox_playable="pigstep"]
- Gives a diamond that plays Pigstep when inserted into a jukebox
kinetic_weapon
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:kinetic_weapon: 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
- [Int] delay_ticks: The time in ticks required before weapon is effective. Defaults to 0.
- [NBT Compound / JSON Object] damage_conditions: The condition under which the charge attack deals damage.
- Kinetic weapon conditions: see Template:Nbt inherit/kinetic_weapon_conditions/template
- [NBT Compound / JSON Object] dismount_conditions: The condition under which the charge attack dismounts the target.
- Kinetic weapon conditions: see Template:Nbt inherit/kinetic_weapon_conditions/template
- [NBT Compound / JSON Object] knockback_conditions: The condition under which the charge attack deals knockback.
- Kinetic weapon conditions: see Template:Nbt inherit/kinetic_weapon_conditions/template
- [Float] forward_movement: The distance the item moves out of the wielder's hand during its animation. Defaults to 0.0.
- [Float] damage_multiplier: The multiplier for the final damage from the relative speed.[note 6] Defaults to 1.0.
- [String][NBT Compound / JSON Object] sound: Optional sound event to play when the weapon is engaged.
- A sound event see Template:Nbt inherit/sound event/template
- [String][NBT Compound / JSON Object] hit_sound: Optional sound event to play when the weapon hits an entity.
- A sound event see Template:Nbt inherit/sound event/template
- [NBT Compound / JSON Object] minecraft:kinetic_weapon: 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
Example: /give @s amethyst_shard[kinetic_weapon={delay_ticks:20,damage_conditions:{max_duration_ticks:120},knockback_conditions:{max_duration_ticks:80},dismount_conditions:{max_duration_ticks:40},sound:"item.spear.use",hit_sound:"block.amethyst_block.hit"}]
- Gives an amethyst shard which can perform a charge attack after a 1-second delay. The attack can damage entities for 6 seconds, knock them back for the first 4 seconds and dismount them for the first 2 seconds. Hitting a target with the attack plays an amethyst sound.
lock
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:lock: An item predicate representing the "key" to open this container. If present on a block, players must have an item that passes this predicate in their main hand in order to open the container. If they do not, interacting with the container will play a sound and display a message in the actionbar.
- item predicate see Template:Nbt inherit/conditions/item/template
- [NBT Compound / JSON Object] minecraft:lock: An item predicate representing the "key" to open this container. If present on a block, players must have an item that passes this predicate in their main hand in order to open the container. If they do not, interacting with the container will play a sound and display a message in the actionbar.
Example 1: /give @p chest[minecraft:lock={components:{"minecraft:item_model":"minecraft:diamond"}}]
- Gives a chest that is locked, opening only if the player is holding an item with the same model as a Diamond.
Example 2: /give @p furnace[minecraft:lock={components:{"minecraft:custom_name":"Furnace Key"}}]
- Gives a furnace that opens only if the player is holding an item with the custom name "Furnace Key".
Example 3: /give @p barrel[minecraft:lock={items:["minecraft:oak_planks","minecraft:diamond"],count:6,predicates:{custom_data:{bar:foo}}}]
- Gives a barrel that opens only if the player is holding exactly 6 oak planks or 6 diamonds that has the custom data
bar:foo
lodestone_tracker
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:lodestone_tracker: Stores information about the lodestone this compass should point toward. If present on a compass item, the base item name will be overridden as "Lodestone Compass". While
trackedin a player's inventory, a compass with this component will do active polling to see if the position of its lodestone is loaded, and if it is and the lodestone has been destroyed then this component is removed.- [NBT Compound / JSON Object] target: Information about the lodestone. Optional. If not set, this compass spins randomly.
- [Int Array] pos: The integer coordinates of the lodestone.
- [String] dimension: The ID of the dimension of the lodestone.
- [Boolean] tracked: If
true, the component is removed when the lodestone is broken. Iffalse, the component is kept. Defaults totrue.
- [NBT Compound / JSON Object] target: Information about the lodestone. Optional. If not set, this compass spins randomly.
- [NBT Compound / JSON Object] minecraft:lodestone_tracker: Stores information about the lodestone this compass should point toward. If present on a compass item, the base item name will be overridden as "Lodestone Compass". While
Example: /give @s compass[minecraft:lodestone_tracker={target:{pos:[I;1,2,3],dimension:"overworld"}}]
- Gives a compass that points toward a lodestone that is located in the Overworld at x=1,y=2,z=3
lore
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:lore: List of additional lines to display in this item's tooltip. Has a maximum of 256 lines.
- [String][NBT List / JSON Array][NBT Compound / JSON Object]: Text component representing a line of text. See Text component format.
- [NBT List / JSON Array] minecraft:lore: List of additional lines to display in this item's tooltip. Has a maximum of 256 lines.
Example 1: /give @p stick[lore=[{text:"This Stick is very sticky."}]]
- Gives a stick with lore in its tooltip.
Example 2: /give @p diamond[lore=[{text:"A shiny Diamond!",italic:false,color:"gold"}]]
- Gives a diamond that has lore in its tooltip. The color of the lore is gold, and its italics have been removed.
Example 3: /give @p emerald[lore=[{text:"A shiny Emerald!","italic":false,"color":"gold"}, {text:"Maybe share it with a friend?",italic:false,color:"yellow"}]]
- 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_decorations
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:map_decorations: Contains key-value pairs of the icons to display on this filled map.
- [NBT Compound / JSON Object] <key>: The key-value pair of a single icon, where the key is an arbitrary unique string identifying the decoration.
- [String] type: The type of the icon. Can be
player,frame,red_marker,blue_marker,target_x,target_point,player_off_map,player_off_limits,mansion,monument,banner_white,banner_orange,banner_magenta,banner_light_blue,banner_yellow,banner_lime,banner_pink,banner_gray,banner_light_gray,banner_cyan,banner_purple,banner_blue,banner_brown,banner_green,banner_red,banner_black,red_x,village_desert,village_plains,village_savanna,village_snowy,village_taiga,jungle_temple,swamp_hut,trial_chambers,abandoned_camp,ancient_city,desert_pyramid,mineshaft, orocean_ruin_warm. - [Double] x: The X world coordinate of the decoration.
- [Double] z: The Z world coordinate of the decoration.
- [Float] rotation: The rotation of the icon, ranging from 0.0 to 360.0, rotated clockwise from north in degrees.
- [String] type: The type of the icon. Can be
- [NBT Compound / JSON Object] <key>: The key-value pair of a single icon, where the key is an arbitrary unique string identifying the decoration.
- [NBT Compound / JSON Object] minecraft:map_decorations: Contains key-value pairs of the icons to display on this filled map.
map_id
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:map_id: The map data number for this item, representing the shared state holding map contents banner and item frames decoration. When present, add information to the tooltip and change the rendering of the item in hand or in the item frame for map rendering. Only maps (
filled_map) and explorer maps can update map content.
- [Int] minecraft:map_id: The map data number for this item, representing the shared state holding map contents banner and item frames decoration. When present, add information to the tooltip and change the rendering of the item in hand or in the item frame for map rendering. Only maps (
max_damage
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:max_damage: The maximum amount of damage that this item can take. If not set, this item cannot take damage. Must be a non-zero positive integer. Cannot be combined with
minecraft:max_stack_sizeif it has a value greater than 1 (if the item can be stacked). For the durability bar to appear, the damage component must have a value. Exampledamage=0.
- [Int] minecraft:max_damage: The maximum amount of damage that this item can take. If not set, this item cannot take damage. Must be a non-zero positive integer. Cannot be combined with
Example: /give @s diamond_pickaxe[max_damage=4]
- Gives a diamond pickaxe that can only be used 4 times before breaking.
max_stack_size
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:max_stack_size: The maximum number of items that can fit in a stack. Must be a positive integer between 1 and 99 (inclusive). If it has a value greater than 1 (if the item can be stacked), cannot be combined with
minecraft:max_damage. If this component is removed, it will behave as though it was set to 1.
- [Int] minecraft:max_stack_size: The maximum number of items that can fit in a stack. Must be a positive integer between 1 and 99 (inclusive). If it has a value greater than 1 (if the item can be stacked), cannot be combined with
Example: /give @s acacia_boat[max_stack_size=64] 5
- Gives a stack of 5 acacia boats all in a single slot.
minimum_attack_charge
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Float] minecraft:minimum_attack_charge: Sets the minimum attack charge on the attack indicator required to attack with this item. Must be a non-negative float between 0.0 and 1.0
Example: /give @s diamond_sword[minimum_attack_charge=0.5] 1
- Gives a diamond sword that can only attack once the attack indicator is at least half full.
mob_visibility
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:mob_visibility: 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.
- [String][NBT List / JSON Array] targeting_entity_types: An entity ID, a list of namespaced entity IDs, or a hash-prefixed entity tag.
- [Float] visibility: The multiplier for the wearer's detectability by the aforementioned mobs. Valid range is
0fto10f. A value of0freduces the wearer's detectability by these mobs to 2 blocks.[more information needed] A value of10fincreases the detection radius tenfold. The maximum total detection multiplier from all equipped items with this component is 10.
- [NBT Compound / JSON Object] minecraft:mob_visibility: 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: /give @s minecraft:chainmail_helmet[minecraft:mob_visibility={targeting_entity_types:"minecraft:skeleton",visibility:0f}]
- Gives a chainmail helmet which prevents skeletons from detecting the wearer unless they are within 2 blocks.
note_block_sound
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:note_block_sound: The ID of the sound event played by a note block when this player head is placed above.
Example: /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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:ominous_bottle_amplifier: The amplifier of the Bad Omen effect given to the player or mob upon consuming this item (normally an ominous bottle). Must be a non-negative integer from 0 to 4 (inclusive). The duration of the effect is always 120000 ticks (1 hour and 40 minutes at the normal tick rate) and
minecraft:potion_duration_scaleis ignored. If present on an item, information about the mob effect is added to the tooltip, in the same format as theminecraft:potion_contentscomponent.
- [Int] minecraft:ominous_bottle_amplifier: The amplifier of the Bad Omen effect given to the player or mob upon consuming this item (normally an ominous bottle). Must be a non-negative integer from 0 to 4 (inclusive). The duration of the effect is always 120000 ticks (1 hour and 40 minutes at the normal tick rate) and
piercing_weapon
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:piercing_weapon: 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.
- [Boolean] deals_knockback: Whether the attack deals knockback. Defaults to true.
- [Boolean] dismounts: Whether the attack dismounts the target. Defaults to false.
- [String][NBT Compound / JSON Object] sound: Optional sound event to play when a player attacks with the weapon.
- A sound event see Template:Nbt inherit/sound event/template
- [String][NBT Compound / JSON Object] hit_sound: Optional sound event to play when the weapon hits an entity.
- A sound event see Template:Nbt inherit/sound event/template
- [NBT Compound / JSON Object] minecraft:piercing_weapon: 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: /give @s minecraft:blaze_rod[minecraft:piercing_weapon={sound:"entity.blaze.hurt",hit_sound:"entity.lightning_bolt.impact"}]
- 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:pot_decorations: 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
minecraft:provides_pottery_patterncomponent, it defines the texture of the corresponding face.- [NBT Compound / JSON Object] left: The item stack in the left side.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object] back: The item stack in the back side.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object] right: The item stack in the right side.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object] front: The item stack in the front side.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object] left: The item stack in the left side.
- [NBT Compound / JSON Object] minecraft:pot_decorations: 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
potion_contents
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT Compound / JSON Object] minecraft:potion_contents: The base potion, custom list of mob effects, and custom color contained in this potion, splash potion, lingering potion, tipped arrow, or area effect cloud. When present on an item, the 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 [String] potion.- A custom potion contents object see Template:Nbt inherit/potion_contents/template
- [String][NBT Compound / JSON Object] minecraft:potion_contents: The base potion, custom list of mob effects, and custom color contained in this potion, splash potion, lingering potion, tipped arrow, or area effect cloud. When present on an item, the mob effects are listed in the item's tooltip. If this and a
potion_duration_scale
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Float] minecraft:potion_duration_scale: When present on an item or area effect cloud that has the
minecraft:potion_contentscomponent, the duration of the applied effects is scaled by this factor.
- [Float] minecraft:potion_duration_scale: When present on an item or area effect cloud that has the
Example: /give @p potion[potion_contents={potion:swiftness},potion_duration_scale=2]
- Gives a Potion of Swiftness that has its default time doubled from 3 Minutes to 6 Minutes.
profile
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT Compound / JSON Object] minecraft:profile: Provides the textures needed for rendering player models (player head blocks, player head item models, and mannequins) and player face sprites. Each texture can be provided either as the namespaced path to a texture in a resource pack, or from a player profile. A player profile can be specified either as player information whose profile properties must be requested on the fly, or a list of already-resolved profile properties.
- If specified as a string, it corresponds to [String] name.
- If present on a player head item, and the [String] name field is specified, the base item name is overridden as "
name's Head". - If present on any item, exactly one of either [String] name or [Int Array] id is specified, and [NBT List / JSON Array] properties is not specified, a gray "Dynamic" text is shown in the item's tooltip.
- [String] name: A username consisting of 0-16 non-whitespace printable ASCII characters. (Note that this is more permissive than actual player usernames, which must be 3-16 characters and may only contain letters, numbers, and underscores.) If no other profile fields are specified, this is used to dynamically request the profile of a player with that username from Mojang's servers. Once received, that profile's properties (such as its skin, cape, and elytra textures) can be used for rendering. If the profile does not exist, an arbitrary default skin is provided (always the same one for the same name). Optional.
- [Int Array] id: A UUID. If no other profile fields are specified, this is used to dynamically request the profile of a player with that UUID from Mojang's servers. Once received, that profile's properties (such as its skin, cape, and elytra textures) can be used for rendering. If the profile does not exist, a random default skin is provided. Optional.
- [NBT List / JSON Array] properties: A non-empty list of user profile properties. If this is specified, the dynamic profile fields are ignored, and a custom profile with these properties is used instead. If set to an empty list, the field is removed rather than invalidating the whole component. Optional.
- [NBT Compound / JSON Object]: A single property.
- [String] name: The name of the property. Can only be
"textures". - [String] value: The texture data json, encoded in base64.
- [String] signature: Optional. Mojang's signature of the value, encoded in base64.
- [String] name: The name of the property. Can only be
- [NBT Compound / JSON Object]: A single property.
- [String] texture: Namespaced path to a player skin texture, relative to the
texturesfolder in a resource pack. If specified, this texture is used when rendering a player model or skin, overriding the skin texture provided by a profile. This skin texture may have transparent pixels on the inner body layers whereas resolved skins' are always opaque. If omitted and no skin is provided by a profile, the slim Alex skin is used (minecraft:entity/player/slim/alex). Optional. - [String] cape: Namespaced path to a cape texture, relative to the
texturesfolder in a resource pack. If specified, this texture is used when rendering a cape, overriding the cape texture provided by a profile. If the resolved profile (or lack thereof) does not have a cape, it will gain one. This does not affect the elytra texture. If Optional. - [String] elytra: Namespaced path to an elytra texture, relative to the
texturesfolder in a resource pack. If specified, this texture is used when rendering an elytra, overriding the elytra texture provided by a profile. This does not affect the cape texture. If omitted and no elytra texture is provided by a profile, the normal elytra texture is used (minecraft:entity/equipment/wings/elytra). Optional. - [String] model: The type of player model to use. Either
"wide"or"slim". If specified, this overrides the model type provided by a profile. If omitted and no model type is provided by a profile, aslimmodel type is used. Optional.
Example: /give @p player_head[profile=MinecraftWiki]
- Gives a player head of MinecraftWiki.
provides_banner_patterns
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT List / JSON Array] minecraft:provides_banner_patterns: Any number of banner pattern(s) (an [String] ID, or a [String] tag with
#, or an [NBT List / JSON Array] array containing [String] IDs). When present, this item can be placed in the pattern slot of a loom and provides the specified banner patterns.
- [String][NBT List / JSON Array] minecraft:provides_banner_patterns: Any number of banner pattern(s) (an [String] ID, or a [String] tag with
Example: /give @p diamond[provides_banner_patterns='#minecraft:pattern_item/globe']
- Gives a diamond that can provide the globe banner pattern to a banner.
provides_pottery_pattern
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:provides_pottery_pattern: One decorated pot pattern (an [String] ID). When present, this item provides the specified pattern when used in a decorated pot side.
provides_trim_material
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String][NBT Compound / JSON Object] minecraft:provides_trim_material: One trim material (an [String] ID, or a new [NBT Compound / JSON Object] trim material definition). When present, this item provides the specified trim material when used in a trimming recipe.[note 7]
- A trim material see Template:Nbt inherit/trim material/template
- [String][NBT Compound / JSON Object] minecraft:provides_trim_material: One trim material (an [String] ID, or a new [NBT Compound / JSON Object] trim material definition). When present, this item provides the specified trim material when used in a trimming recipe.[note 7]
rarity
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:rarity: Sets the rarity of this item, which affects the default color of its name. Can be
common,uncommon,rare, orepic. If this component does not exist on the item, thencommonis used.
- [String] minecraft:rarity: Sets the rarity of this item, which affects the default color of its name. Can be
Example: /give @p iron_sword[rarity=epic]
- Gives an iron sword with a light purple name.
recipes
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:recipes: The recipes that a player unlocks when this knowledge book is used.
- [String]: The ID of a recipe.
- [NBT List / JSON Array] minecraft:recipes: The recipes that a player unlocks when this knowledge book is used.
Example: /give @p knowledge_book[recipes=["minecraft:end_crystal","minecraft:diamond","minecraft:stone_sword","minecraft:blast_furnace"]]
- Gives a knowledge book that, when used, gives the player the recipes listed inside the component.
repair_cost
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:repair_cost: The number of experience levels to add to the base level cost when repairing, combining, or renaming this item with an anvil. Must be a non-negative integer, defaults to 0.
repairable
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:repairable: 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.
- [String][NBT List / JSON Array] items: Item, list of Items, or hash-prefixed Item Tag matching what can be used to repair this item.
- [NBT Compound / JSON Object] minecraft:repairable: 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: /give @p diamond_sword[repairable={items:"stick"}]
- Gives a diamond sword that can be repaired with sticks in an anvil.
sign_text_back
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:sign_text_back: The text displayed on the back side of this sign. If present on an item, the lines of text are shown indented in the tooltip, with a line saying "Back text:" before them.
- [NBT List / JSON Array] messages: A list of four text components, one for each line.
- [String][NBT List / JSON Array][NBT Compound / JSON Object]: Text for each line. Must be a valid text component. The length limit when messages are typed out or displayed in-game depends on the width of the characters in the font you are using, with a hard limit of 50 characters when typing. However, this character limit is not enforced onto the text components, so they can be arbitrarily long (though they may not fully be displayed).
- [NBT List / JSON Array] filtered_messages: Only in Realms. The lines of text shown to players with the profanity filter turned on instead of the regular lines. This tag is automatically set to
""for lines containing blocked words and to the line's normal contents for the other lines when a player with the profanity filter turned off edits the sign, so players with the filter on cannot see the blocked words. If a player with the filter on tries to use blocked words in one or more lines, the line(s) in [NBT List / JSON Array] messages containing blocked words are set to"", which makes them render completely blank, and this tag is also given the same contents. If multiple lines have been edited before the sign editing GUI is closed, only the lines containing blocked words are blanked. - [String] color: The color that has been used to dye the sign. The default value is
blackOne ofwhite,orange,magenta,light_blue,yellow,lime,pink,gray,light_gray,cyan,purple,blue,brown,green,red, andblack. - [Boolean] has_glowing_text: Optional, defaults to
false.trueif the sign has been dyed with a glow ink sac.
- [NBT List / JSON Array] messages: A list of four text components, one for each line.
- [NBT Compound / JSON Object] minecraft:sign_text_back: The text displayed on the back side of this 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:sign_text_front: The text displayed on the front side of this sign. If present on an item, the lines of text are shown indented in the tooltip, with a line saying "Front text:" before them.
- [NBT List / JSON Array] messages: A list of four text components, one for each line.
- [String][NBT List / JSON Array][NBT Compound / JSON Object]: Text for each line. Must be a valid text component. The length limit when messages are typed out or displayed in-game depends on the width of the characters in the font you are using, with a hard limit of 50 characters when typing. However, this character limit is not enforced onto the text components, so they can be arbitrarily long (though they may not fully be displayed).
- [NBT List / JSON Array] filtered_messages: Only in Realms. The lines of text shown to players with the profanity filter turned on instead of the regular lines. This tag is automatically set to
""for lines containing blocked words and to the line's normal contents for the other lines when a player with the profanity filter turned off edits the sign, so players with the filter on cannot see the blocked words. If a player with the filter on tries to use blocked words in one or more lines, the line(s) in [NBT List / JSON Array] messages containing blocked words are set to"", which makes them render completely blank, and this tag is also given the same contents. If multiple lines have been edited before the sign editing GUI is closed, only the lines containing blocked words are blanked. - [String] color: The color that has been used to dye the sign. The default value is
blackOne ofwhite,orange,magenta,light_blue,yellow,lime,pink,gray,light_gray,cyan,purple,blue,brown,green,red, andblack. - [Boolean] has_glowing_text: Optional, defaults to
false.trueif the sign has been dyed with a glow ink sac.
- [NBT List / JSON Array] messages: A list of four text components, one for each line.
- [NBT Compound / JSON Object] minecraft:sign_text_front: The text displayed on the front side of this 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:stored_enchantments: Contains a map of inactive enchantments and their levels. Adding this component to any item other than an 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.- [Int] <enchantment ID>: A single key-value pair, where the key is the identifier of an enchantment, and the value is the level.
- [NBT Compound / JSON Object] minecraft:stored_enchantments: Contains a map of inactive enchantments and their levels. Adding this component to any item other than an 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] sulfur_cube_content: The item stored inside the sulfur cube. When present on a sulfur cube entity, this component doubles as the
armor.bodyslot (bodyequipment slot). When present on an item, gray italic text is added to the tooltip that says "Contains:<item>".- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object] sulfur_cube_content: The item stored inside the sulfur cube. When present on a sulfur cube entity, this component doubles as the
suspicious_stew_effects
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT List / JSON Array] minecraft:suspicious_stew_effects: A list of unamplified mob effects given to the player or mob upon consuming this item (normally a suspicious stew).
minecraft:potion_duration_scaleis ignored. When present on an item, text is added to the item's tooltip only when it is inside of the item selection screen.- [NBT Compound / JSON Object]: A single custom effect.
- [String] id: The ID of the effect.
- [Int] duration: The duration of the effect in ticks. Defaults to 160.
- [NBT Compound / JSON Object]: A single custom effect.
- [NBT List / JSON Array] minecraft:suspicious_stew_effects: A list of unamplified mob effects given to the player or mob upon consuming this item (normally a suspicious stew).
tool
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:tool: If set, this item is considered as a tool.
- [Float] default_mining_speed: The default mining speed of this tool, used if no rules override it. Defaults to 1.0.
- [Int] damage_per_block: The amount of durability to remove each time a block is broken with this tool. Must be a non-negative integer. Defaults to 1.
- [Boolean] can_destroy_blocks_in_creative: Whether players can break blocks while holding this tool in Creative mode. Defaults to
true. - [NBT List / JSON Array] rules: A list of rules for the blocks that this tool has a special behavior with. If a field is overridden by multiple matched rules, the one that comes first in the list is chosen.
- [NBT Compound / JSON Object]: A single rule.
- [String][NBT List / JSON Array] blocks: The blocks to match with. Can be a block ID or a block tag with a
#, or a list of block IDs. - [Float] speed: If the blocks match, overrides the default mining speed. Optional.
- [Boolean] correct_for_drops: If the blocks match, overrides whether or not this tool is considered correct to mine at its most efficient speed, and to drop items if the block's loot table requires it. If not set by any rules, defaults to
false. Optional.
- [String][NBT List / JSON Array] blocks: The blocks to match with. Can be a block ID or a block tag with a
- [NBT Compound / JSON Object]: A single rule.
- [NBT Compound / JSON Object] minecraft:tool: If set, this item is considered as a tool.
Example: /give @p oak_fence[max_stack_size=1,max_damage=350,damage=0,tool={default_mining_speed:1.5,damage_per_block:2,rules:[{blocks:"#mineable/pickaxe",speed:6,correct_for_drops:true}]}]
- Gives an oak fence that has the properties of a pickaxe.
tooltip_display
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:tooltip_display: Allows the tooltips provided specifically by any given item component to be suppressed.
- [Boolean] hide_tooltip: If true, the item has no tooltip when hovered.
- [NBT List / JSON Array] hidden_components: The tooltips provided by any component in this list are hidden. If that component provides no tooltip, it has no effect.
- [String]: The identifier of a component
- [NBT Compound / JSON Object] minecraft:tooltip_display: Allows the tooltips provided specifically by any given item component to be suppressed.
Example 1: /give @p diamond_sword[tooltip_display={hidden_components:["minecraft:enchantments"]},enchantments={sharpness:1}]
- Gives a diamond sword that is enchanted with Sharpness I, but doesn't show the enchantments in the tooltip.
Example 2: /give @p diamond_sword[tooltip_display={hide_tooltip:1b}]
- Gives a diamond sword that when hovered, it shows no tooltip at all.
tooltip_style
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:tooltip_style: The identifier of the custom sprites for the 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 missing texture.
trim
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:trim: Contains the trim applied to this armor piece. If present on an item, information about the armor trim is added to the item's tooltip.
- [String][NBT Compound / JSON Object] pattern: One trim pattern (an [String] ID, or a new [NBT Compound / JSON Object] trim pattern definition).
- A trim pattern see Template:Nbt inherit/trim pattern/template
- [String][NBT Compound / JSON Object] material: One trim material (an [String] ID, or a new [NBT Compound / JSON Object] trim material definition).
- A trim material see Template:Nbt inherit/trim material/template
- [String][NBT Compound / JSON Object] pattern: One trim pattern (an [String] ID, or a new [NBT Compound / JSON Object] trim pattern definition).
- [NBT Compound / JSON Object] minecraft:trim: Contains the trim applied to this armor piece. If present on an item, information about the armor trim is added to the item's tooltip.
Example: /give @p minecraft:leather_leggings[trim={"pattern":"host","material":"emerald"}] 1
- Gives leather pants with the "host" pattern made of emerald.
unbreakable
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:unbreakable: 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:use_cooldown: If present, this item applies a use cooldown to all items of the same type when it has been used.
- [Float] seconds: The use cooldown duration in seconds.
- [String] cooldown_group: The unique identifier 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.
- [NBT Compound / JSON Object] minecraft:use_cooldown: If present, this item applies a use cooldown to all items of the same type when it has been used.
Example: /give @p ender_pearl[use_cooldown={seconds:10,cooldown_group:"foo:bar"}]
- 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:use_effects: Defines the vibrations and player movement penalties when an item with a continuous use action is being used.
- [Boolean] can_sprint: If the player can sprint during use. Defaults to
false. - [Float] speed_multiplier: A ranged float (0.0-1.0 inclusive) speed multiplier inflicted during use. Defaults to
0.2. - [Boolean] interact_vibrations: Whether using this item emits the
minecraft:item_interact_startandminecraft:item_interact_finishgame events. Defaults totrue.
- [Boolean] can_sprint: If the player can sprint during use. Defaults to
- [NBT Compound / JSON Object] minecraft:use_effects: Defines the vibrations and player movement penalties when an item with a continuous use action is being used.
use_remainder
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:use_remainder: If present, replaces the item with a remainder item if its stack count has decreased after use.
- A single item stack see Template:Nbt inherit/itemnoslot/template
- [NBT Compound / JSON Object] minecraft:use_remainder: If present, replaces the item with a remainder item if its stack count has decreased after use.
Example 1: /give @p splash_potion[use_remainder={id:"minecraft:gunpowder"}]
- Gives a splash potion, which after being thrown, leaves gunpowder.
Example 2: /give @p cooked_chicken[use_remainder={id:"minecraft:bone",components:{custom_name:{text:"Chicken Bone"}},count:2}]
- Gives a cooked chicken, which after being used, turns into 2 bones named "Chicken Bone".
villager_food
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:villager_food: If present, villagers will be able to pick up and eat the item.
- [Int] nutrition: A positive integer representing how many nutrition points the item provides to villagers.
- [NBT Compound / JSON Object] minecraft:villager_food: If present, villagers will be able to pick up and eat the item.
Example: /give @s minecraft:golden_apple[villager_food={nutrition:12}] 1
- Gives a golden apple that provides villagers with enough nutrition to breed all by itself.
waxed
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:waxed: If present, the block's contents are waxed. Does not apply to blocks with separate waxed variants; for those, use the appropriate
block_stateinstead.
- [NBT Compound / JSON Object] minecraft:waxed: If present, the block's contents are waxed. Does not apply to blocks with separate waxed variants; for those, use the appropriate
Example: /give @s minecraft:oak_sign[waxed={},sign_text_front={messages:["","Hello there!","",""]}] 1
- Gives an oak sign with the text "Hello there!" waxed in place.
weapon
[edit | edit source]If present, the item acts as a weapon. For attack damage see the attribute_modifiers component.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:weapon: When present, the specified amount of damage can be done to the item with each attack. Additionally, the 'Item Used' statistic is incremented for each attack with the item.
- [Int] item_damage_per_attack: The amount to damage the item for each attack performed. Defaults to
1. - [Float] disable_blocking_for_seconds: The amount of seconds that this item can disable a blocking shield on successful attack. If set to 0, this item cannot disable a blocking shield. Defaults to
0.
- [Int] item_damage_per_attack: The amount to damage the item for each attack performed. Defaults to
- [NBT Compound / JSON Object] minecraft:weapon: When present, the specified amount of damage can be done to the item with each attack. Additionally, the 'Item Used' statistic is incremented for each attack with the item.
Example 1: /give @p minecraft:stick[weapon={},max_damage=10,max_stack_size=1,damage=0]
- Gives a stick that has 10 durability, and loses 1 durability for each attack performed.
Example 2: /give @p iron_sword[minecraft:weapon={disable_blocking_for_seconds:5,item_damage_per_attack:10}]
- 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:writable_book_content: The contents of this book and quill. Adding this component to any item other than a
writable_bookdoes nothing. If this component is removed from awritable_bookitem, attempting to use the item will still swing the arm and increment itsusedstatistic, but no UI will appear.- [NBT List / JSON Array] pages: A list of the pages in the book.
- [NBT Compound / JSON Object] or [String]: A single page. If set to a string, it corresponds to [String] raw.
- [String] raw: The plain text content of the page.
- [String] filtered: The filtered text of the page. Optional. Shown only to players with chat filter enabled, instead of [String] raw.
- [NBT Compound / JSON Object] or [String]: A single page. If set to a string, it corresponds to [String] raw.
- [NBT List / JSON Array] pages: A list of the pages in the book.
- [NBT Compound / JSON Object] minecraft:writable_book_content: The contents of this book and quill. Adding this component to any item other than a
written_book_content
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:written_book_content: The contents and metadata of this written book. Adding this component to any item other than a
written_bookdoes nothing except add text to the item tooltip. If this component is removed from awritten_bookitem, attempting to use the item will still swing the arm and increment itsusedstatistic, but no UI will appear.- [NBT List / JSON Array] pages: A list of the pages in the book.
- [NBT Compound / JSON Object] or [String][NBT List / JSON Array][NBT Compound / JSON Object]: A single page. If set to a string, list, or compound with no
raworfilteredtags in it, it corresponds to [String][NBT List / JSON Array][NBT Compound / JSON Object] raw.- [String][NBT List / JSON Array][NBT Compound / JSON Object] raw: A text component representing the text content of the page. See Text component format.
- [String][NBT List / JSON Array][NBT Compound / JSON Object] filtered: A text component representing the filtered text of the page. Optional. Shown only to players with chat filter enabled, instead of [String] raw.
- [NBT Compound / JSON Object] or [String][NBT List / JSON Array][NBT Compound / JSON Object]: A single page. If set to a string, list, or compound with no
- [String][NBT Compound / JSON Object] title: The title of this written book. Overrides the base item name. If set to an empty string, it is ignored and does not override the base item name. If set to a string, it corresponds to [String] raw.
- [String] raw: The plain text title. Has a maximum length of 32 characters.
- [String] filtered: The filtered title. Optional. Shown only to players with chat filter enabled, instead of [String] raw.
- [String] author: The author of this written book. This is shown in the item tooltip.
- [Int] generation: The number of times this written book has been copied. 0 = original, 1 = copy of original, 2 = copy of copy, 3 = tattered. Defaults to 0. If the value is greater than 1, the book cannot be copied. If specified, this is shown in the item tooltip.
- [Boolean] resolved: If
true, the text components have already been resolved by the server. Iffalse, they are resolved either when the book is opened by an operator, when the book is placed into a lectern by an operator, or when the item stack is written to a lectern'sBooktag by a command. Defaults tofalse.
- [NBT List / JSON Array] pages: A list of the pages in the book.
- [NBT Compound / JSON Object] minecraft:written_book_content: The contents and metadata of this written book. Adding this component to any item other than a
Entity variant components
[edit | edit source]Additional note: Add more information about entity variant components (in general)
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
cat/collar
cat/sound_variant
cat/variant
chicken/sound_variant
chicken/variant
cow/sound_variant
cow/variant
cushion/color
fox/variant
frog/variant
horse/variant
llama/variant
mooshroom/variant
painting/variant
parrot/variant
pig/sound_variant
pig/variant
rabbit/variant
salmon/size
sheep/color
shulker/color
tropical_fish/base_color
tropical_fish/pattern
tropical_fish/pattern_color
villager/variant
wolf/collar
wolf/sound_variant
wolf/variant
zombie_nautilus/variant
axolotl/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:axolotl/variant:
lucy,wild,gold,cyan, orblue— The variant of the axolotl
- [String] minecraft:axolotl/variant:
Example: /give @s axolotl_spawn_egg[axolotl/variant="blue"]
- Gives a axolotl spawn egg that spawns a blue axolotl.
cat/collar
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:cat/collar: A dye color — The color of the collar of the cat
Example: /give @s cat_spawn_egg[cat/collar="blue"]
- Gives a cat spawn egg that spawns a cat with a blue collar (once tamed).
cat/sound_variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:cat/sound_variant: One cat sound variant (an [String] ID) — The sound variant of the cat.
Example: /give @s cat_spawn_egg[cat/sound_variant="royal"]
- Gives a cat spawn egg that spawns a cat with "royal" sound variant.
cat/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:cat/variant: One cat variant (an [String] ID) — The variant of the cat
Example: /give @s cat_spawn_egg[cat/variant="jellie"]
- Gives a cat spawn egg that spawns a Jellie (gray and white) cat.
chicken/sound_variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:chicken/sound_variant: One chicken sound variant (an [String] ID) — The sound variant of the chicken.
Example 1: /give @s chicken_spawn_egg[chicken/sound_variant="picky"]
- Gives a chicken spawn egg that spawns a chicken with "picky" sound variant.
Example 2: /give @s egg[chicken/sound_variant="picky"]
- Gives an egg that has a chance to hatch a chicken with "picky" sound variant.
chicken/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:chicken/variant: One chicken variant (an [String] ID) — The variant of the chicken
Example 1: /give @s chicken_spawn_egg[chicken/variant="cold"]
- Gives a chicken spawn egg that spawns a cold chicken.
Example 2: /give @s egg[chicken/variant="cold"]
- Gives an egg that has a chance to hatch a cold chicken.
cow/sound_variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:cow/sound_variant: One cow sound variant (an [String] ID) — The sound variant of the cow.
Example: /give @s cow_spawn_egg[cow/sound_variant="moody"]
- Gives a cow spawn egg that spawns a cow with "moody" sound variant.
cow/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:cow/variant: One cow variant (an [String] ID) — The variant of the cow
Example: /give @s cow_spawn_egg[cow/variant="cold"]
- Gives a cow spawn egg that spawns a cold cow.
cushion/color
[edit | edit source]Example: /give @s red_cushion[cushion/color="purple"]
- Gives a red cushion item that spawns a purple cushion entity.
fox/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:fox/variant:
redorsnow— The variant of the fox
- [String] minecraft:fox/variant:
Example: /give @s fox_spawn_egg[fox/variant="snow"]
- Gives a fox spawn egg that spawns a snow fox.
frog/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:frog/variant: One frog variant (an [String] ID) — The variant of the frog
Example: /give @s frog_spawn_egg[frog/variant="cold"]
- Gives a frog spawn egg that spawns a cold frog.
horse/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:horse/variant:
white,creamy,chestnut,brown,black,gray, ordark_brown— The variant of the horse
- [String] minecraft:horse/variant:
Example: /give @s horse_spawn_egg[horse/variant="chestnut"]
- Gives a horse spawn egg that spawns a chestnut horse.
llama/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:llama/variant:
creamy,white,brown, orgray— The variant of the llama
- [String] minecraft:llama/variant:
Example: /give @s llama_spawn_egg[llama/variant="gray"]
- Gives a llama spawn egg that spawns a gray llama.
mooshroom/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:mooshroom/variant:
redorbrown— The variant of the mooshroom
- [String] minecraft:mooshroom/variant:
Example: /give @s mooshroom_spawn_egg[mooshroom/variant="brown"]
- Gives a mooshroom spawn egg that spawns a brown mooshroom.
painting/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:painting/variant: One painting variant (an [String] ID) — The variant of the 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 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: /give @s painting[painting/variant="plant"]
- Gives a painting that places the "Paradisträd" painting.
parrot/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:parrot/variant:
red_blue,blue,green,yellow_blue, orgray— The variant of the parrot
- [String] minecraft:parrot/variant:
Example: /give @s parrot_spawn_egg[parrot/variant="blue"]
- Gives a parrot spawn egg that spawns a blue parrot.
pig/sound_variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:pig/sound_variant: One pig sound variant (an [String] ID) — The sound variant of the pig.
Example: /give @s pig_spawn_egg[pig/sound_variant="big"]
- Gives a pig spawn egg that spawns a pig with "big" sound variant.
pig/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:pig/variant: One pig variant (an [String] ID) — The variant of the pig
Example: /give @s pig_spawn_egg[pig/variant="warm"]
- Gives a pig spawn egg that spawns a warm pig.
rabbit/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:rabbit/variant:
brown,white,black,white_splotched,gold,salt, orevil— The variant of the rabbit
- [String] minecraft:rabbit/variant:
Example: /give @s rabbit_spawn_egg[rabbit/variant="evil"]
- Gives a rabbit spawn egg that spawns an evil rabbit.
salmon/size
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:salmon/size:
small,medium,large— The size of the salmon
- [String] minecraft:salmon/size:
Example: /give @s salmon_spawn_egg[salmon/size="large"]
- Gives a salmon spawn egg that spawns a large salmon.
sheep/color
[edit | edit source]Example: /give @s sheep_spawn_egg[sheep/color="blue"]
- Gives a sheep spawn egg that spawns a sheep with blue wool.
shulker/color
[edit | edit source]Example: /give @s shulker_spawn_egg[shulker/color="red"]
- Gives a shulker spawn egg that spawns a red shulker.
tropical_fish/base_color
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:tropical_fish/base_color: A dye color — The base color of the tropical fish
tropical_fish/pattern
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:tropical_fish/pattern:
kob,sunstreak,snooper,dasher,brinely,spotty,flopper,stripey,glitter,blockfish,betty, orclayfish— The pattern of the tropical fish
- [String] minecraft:tropical_fish/pattern:
tropical_fish/pattern_color
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:tropical_fish/pattern_color: A dye color — The pattern color of the tropical fish
Example: /give @s tropical_fish_spawn_egg[tropical_fish/pattern="snooper", tropical_fish/base_color="red", tropical_fish/pattern_color="blue"]
- Gives a tropical fish spawn egg that spawns a red-blue snooper tropical fish.
villager/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:villager/variant:
desert,jungle,plains,savanna,snow,swamp, ortaiga— The variant of the villager
- [String] minecraft:villager/variant:
Example: /give @s villager_spawn_egg[villager/variant="desert"]
- Gives a villager spawn egg that spawns a desert villager.
wolf/collar
[edit | edit source]Example: /give @s wolf_spawn_egg[wolf/collar="blue"]
- Gives a wolf spawn egg that spawns a wolf with a blue collar (when tamed).
wolf/sound_variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:wolf/sound_variant: wolf sound variant definition — The sound variant of the wolf
Example: /give @s wolf_spawn_egg[wolf/sound_variant="cute"]
- Gives a wolf spawn egg that spawns a cute wolf.
wolf/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:wolf/variant: One wolf variant (an [String] ID) — The variant of the wolf
Example: /give @s wolf_spawn_egg[wolf/variant="rusty"]
- Gives a wolf spawn egg that spawns a rusty wolf.
zombie_nautilus/variant
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:zombie_nautilus/variant: One zombie nautilus variant (an [String] ID) — The variant of the zombie nautilus.
Example: /give @s zombie_nautilus_spawn_egg[zombie_nautilus/variant="warm"]
- Gives a zombie nautilus spawn egg that spawns a warm zombie nautilus.
Non-encoded components
[edit | edit source]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 /data.
additional_trade_cost
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:additional_trade_cost: Used on the
givesitem of a villager trade to add to thecountof thewantsitem.
- [Int] minecraft:additional_trade_cost: Used on the
creative_slot_lock
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:creative_slot_lock: Only used internally to lock the informational paper items in the creative inventory. If set, this item cannot be taken out of its slot.
map_post_processing
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:map_post_processing: Only used internally when this filled map has been duplicated or locked in a crafting table or a 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
[edit | edit source]The following components were added and used in April Fools' Day joke snapshots.
clicks
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:clicks: The number of times this poisonous potato plant has been clicked in the inventory.
contacts_messages
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Long Array] minecraft:contacts_messages: Used by the poisonous potato plant.
explicit_foil
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Boolean] minecraft:explicit_foil: Whether or not this item should display a glint.
fletching
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:fletching: Information about this fletching table.
- [String] quality: A single character defining the quality of this block.
- [String] impurities: A single character defining the impurity of this block.
- [String] next_level_impurities: A single character defining the impurity of the next level of this block.
- [Short] processs_time [sic]: The process time of this block, in ticks.
- [Boolean] explored: Whether this block has been explored.
- [NBT Compound / JSON Object] minecraft:fletching: Information about this fletching table.
heat
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:heat: Information about this hot potato.
- [Int] heat: The amount of heat. Has a maximum value of 200.
- [Int] slot: The inventory slot this item is in.
- [Int Array] owner: The UUID of the entity currently holding this item.
- [NBT Compound / JSON Object] minecraft:heat: Information about this hot potato.
hovered
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Boolean] minecraft:hovered: Whether or not this poisonous potato plant is the last item stack hovered in the inventory.
lubrication
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:lubrication
- [Int] level: The level of slipperiness this item has when thrown on the ground.
- [NBT Compound / JSON Object] minecraft:lubrication
potato_bane
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:potato_bane: Used by the potato peeler.
- [Float] damage_boost: The amount of bonus damage applied to potato mobs.
- [NBT Compound / JSON Object] minecraft:potato_bane: Used by the potato peeler.
resin
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:resin: Information about this toxic resin.
- [String] quality: A single character defining the quality of this item. Used to prefix the "Clarity" line on the tooltip.
- [String] impurities: A single character defining the impurity of this item. Used to prefix the "Impurities" line on the tooltip.
- [NBT Compound / JSON Object] minecraft:resin: Information about this toxic resin.
secret_message
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Long] minecraft:secret_message: Used by the poisonous potato plant.
snek
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:snek: Information about this snektato.
- [Boolean] revealed: Whether or not this item has been eaten yet. When
true, its name is "Venomous Potato" and its texture is different.
- [Boolean] revealed: Whether or not this item has been eaten yet. When
- [NBT Compound / JSON Object] minecraft:snek: Information about this snektato.
undercover_id
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:undercover_id: Used by the poisonous potato plant.
views
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:views: Used by the poisonous potato plant.
xp
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:xp: The amount of experience points granted by this potato of knowledge.
dimension_id
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:dimension_id: The resource location of the dimension this mine item will teleport the player to when placed on a mine revisitor and used.
exchange_value
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Float] minecraft:exchange_value: The value of the item, which is used to determine how much experience the player gains from it when exiting a mine.
instant_room
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:instant_room: The room this shimmering key opens.
- [String] structure: The resource location of the structure. The key can only open a room if a structure file with the specified name exists inside the
hub/room/folder under the specified namespace in a data pack.
- [String] structure: The resource location of the structure. The key can only open a room if a structure file with the specified name exists inside the
- [NBT Compound / JSON Object] minecraft:instant_room: The room this shimmering key opens.
mine_active
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:mine_active: Is set on the mine item in the mine crafter when the player is inside a mine.
mine_completed
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Boolean] minecraft:mine_completed: 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
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:mob_trophy/type: Information about this mob trophy.
- [Boolean] shiny: Whether the mob inside this mob trophy has an enchantment glint on it. Also adds the text "Oooh, shiny!" to the tooltip.
- [String] type: The resource location for the entity type inside this mob trophy.
- [NBT Compound / JSON Object] minecraft:mob_trophy/type: Information about this mob trophy.
sky
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:sky: Information about this sky box.
- [String] type: The type of sky that sky blocks render. Must be one of
overworld,end,cube,panorama,code. - If the value is
cube, there are additional fields that are required: - [String] texture: A resource location pointing to a texture asset.
- [Int] repeats: The number of times the texture will be tiled horizontally and vertically on each plane of the cube.
- [Float] size: Is set to 400.0 for sky boxes in the boiler room.[more information needed]
- [String][NBT List / JSON Array][NBT Compound / JSON Object] name: A text component that will be shown as the name of the sky in the "Sky:" line of the tooltip.
- [String] type: The type of sky that sky blocks render. Must be one of
- [NBT Compound / JSON Object] minecraft:sky: Information about this sky box.
special_mine
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:special_mine: The resource location of the special mine this mine item teleports the player to.
trophy/type
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [String] minecraft:trophy/type: The type of this trophy. Must be one of
gold,mega_spud,no_medal.
- [String] minecraft:trophy/type: The type of this trophy. Must be one of
world_effect_uhint
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:world_effect_uhint: [more information needed]
world_effect_unlock
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:world_effect_unlock: [more information needed]
world_modifiers
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:world_modifiers: The mine ingredients included in the mine this mine item teleports the player to.
- [NBT List / JSON Array] effects: List of resource locations of world modifiers included in the mine.
- [String]: A world modifier.
- [Boolean] include_description: Whether to show the mine ingredients in the tooltip of this mine item.
- [NBT List / JSON Array] effects: List of resource locations of world modifiers included in the mine.
- [NBT Compound / JSON Object] minecraft:world_modifiers: The mine ingredients included in the mine this mine item teleports the player to.
follow
[edit | edit source]- [NBT Compound / JSON Object] components: Parent tag.
- [Boolean] minecraft:follow: [more information needed]
Removed components
[edit | edit source]map_color
[edit | edit source]This component was removed in 26.3. Now each exploration map has its own model, instead of using a single model with a colored layer.
- [NBT Compound / JSON Object] components: Parent tag.
- [Int] minecraft:map_color: The color code for the
minecraft:map_colorcolor provider in item model definitions. Normally used by theminecraft:filled_mapitem model.
- [Int] minecraft:map_color: The color code for the
Example: /give @s filled_map[map_color=16711680]
- Gives a filled map with red markings on item texture.
swing_animation
[edit | edit source]This component was split into attack_animation and interact_animation in 26.3.
- [NBT Compound / JSON Object] components: Parent tag.
- [NBT Compound / JSON Object] minecraft:swing_animation: Allows modification of the swinging animation.
- [String] type: The type of swinging animation. Can be
none,whack,stab. Defaults towhack. - [Int] duration: A positive integer that determines the animation's duration in ticks. Defaults to
6.
- [String] type: The type of swinging animation. Can be
- [NBT Compound / JSON Object] minecraft:swing_animation: Allows modification of the swinging animation.
History
[edit | edit source]- later 26.1 changes
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.20.5 | 24w09a | Replaced [NBT Compound / JSON Object] tag tag and all underlying item-specific tags[more information needed] with data components. | |||||
| Replaced [Byte] Count with [Int] count. | |||||||
| Some formerly hardcoded item properties are now also components now.[more information needed] | |||||||
| 24w10a | Renamed lodestone_target component to lodestone_tracker, and moved [Int Array] pos and [String] dimension fields to [NBT Compound / JSON Object] target.
| ||||||
profile, dyed_color, attribute_modifiers, potion_contents, enchantments, and stored_enchantments components can now optionally be defined in simpler formats.
| |||||||
lore and fireworks components now allow up to 256 entries in their list.
| |||||||
container component now applies to all containers, instead of only shulker boxes.
| |||||||
[String] name is no longer required in profile component.
| |||||||
| Something has changed in this snapshot such that invalid banner_pattern values for shields and banners can now be specified.[more information needed] | |||||||
| 24w12a | Added food, max_stack_size, max_damage, fire_resistant, rarity, tool, and hide_tooltip components.
| ||||||
The old {...} item format has been removed, and can no longer be used as a shortcut for custom_data component. | |||||||
| 24w13a | Added item_name, and ominous_bottle_amplifier components.
| ||||||
| Components with non-default values on block items are now stored on block entities when placed. | |||||||
| 24w14a | Renamed [String] text to [String] raw in writable_book_content, and written_book_content components. | ||||||
| Pre-Release 1 | Renamed [Float] saturation_modifier to [Float] saturation in food component.
| ||||||
max_damage, and max_stack_size components can no longer be put together. | |||||||
| 1.21 | 24w19a | custom_data component can now be defined as a SNBT string.
| |||||
Added [NBT Compound / JSON Object] using_converts_to in food component. | |||||||
| 24w21a | Added jukebox_playable component.
| ||||||
Changed attribute_modifiers component: removed [String] name and [Int Array] uuid fields, added [String] id field. | |||||||
| 1.21.2 | 24w33a | Added repairable and enchantable components.
| |||||
The title specified in the written_book_content component is now prioritized over custom_name and item_name for any item with a non-empty title in this component. | |||||||
| 24w34a | Added consumable, use_cooldown and use_remainder components.
| ||||||
The food component has been changed to become a data container that holds only the food stats applied when the item is consumed. The component no longer gives the item the ability to be consumed. Removed the [Float] eat_seconds, [NBT Compound / JSON Object] using_converts_to and [NBT List / JSON Array] effects fields from food. | |||||||
| 24w36a | Added equippable, item_model, glider and tooltip_style components.
| ||||||
The item_name component is now always present on every item. | |||||||
| 24w37a | Added death_protection component.
| ||||||
Renamed fire_resistant component to damage_resistant, and added [String] types field.
| |||||||
The name provided by the item_name component now always has the lowest priority.
| |||||||
Added [String] custom_name in potion_contents component.
| |||||||
Added [Boolean] swappable and [Boolean] damage_on_hurt in equippable component. | |||||||
| 24w39a | The lock component is now a compound that represents an item predicate. | ||||||
| Pre-Release 1 | Added [String] camera_overlay in equippable component. | ||||||
| 1.21.4 | 24w45a | custom_model_data now has more fields to accommodate new uses by various model property getters: floats, flags, strings and colors.
| |||||
item_model now uses assets/[namespace]/items/, rather than assets/[namespace]/models/item.
| |||||||
The equippable component had its field model renamed to asset_id. | |||||||
| 1.21.5 | 25w02a | Added weapon and potion_duration_scale components.
| |||||
Added new optional field [Boolean] can_destroy_blocks_in_creative to tool component. | |||||||
| 25w03a | [Int] damage_per_attack field in weapon component was renamed to [Int] item_damage_per_attack
| ||||||
equippable component can now apply to saddle slot, and has a new optional field: [Boolean] equip_on_interact.
| |||||||
| Added 21 components, all of which are entity variant components. | |||||||
| 25w04a | Added the blocks_attacks, break_sound, provides_banner_patterns, provides_trim_material and tooltip_display components.
| ||||||
Removed the hide_tooltip and hide_additional_tooltip components in favor of the new tooltip_display component.
| |||||||
Removed the [Boolean] show_in_tooltip field from all components that previously had it in favor of the new tooltip_display component.
| |||||||
[Boolean] can_disable_blocking field in weapon component was renamed to [Float] disable_blocking_for_seconds.
| |||||||
Most components that used to have two fields (one of them being the [Boolean] show_in_tooltip field) now always use their simplified form, with the other one field inlined to top-level. For example: enchantments={levels:{sharpness:2}} -> enchantments={sharpness:2} | |||||||
| 25w05a | Added [String] bypassed_by field to blocks_attacks component.
| ||||||
Added [Float] horizontal_blocking_angle field to objects within [NBT List / JSON Array] damage_reduction field to blocks_attacks component.
| |||||||
Added cow/variant entity variant component. | |||||||
| 25w06a | Added chicken/variant entity variant component. | ||||||
| 25w08a | Added wolf/sound_variant entity variant component. | ||||||
| 1.21.6 | 25w15a | Added optional [NBT Compound / JSON Object] display field to attributes_modifiers. | |||||
| 25w16a | The painting/variant component no longer allows inline paining variant definitions. | ||||||
| 25w20a | Added optional [Boolean] can_be_sheared and [String][NBT Compound / JSON Object] shearing_sound fields to equippable. | ||||||
| 1.21.9 | 25w34a | Player profiles in data components and block entities no longer resolve automatically. | |||||
The minecraft:profile component has now two behaviors, Static or Dynamic, depending on which fields are specified. | |||||||
| Pre-Release 1 | minecraft:profile: Profiles can now also have additional fields that can replace various values used for rendering; if any of the fields are omitted, the value from the resolved profile is used, even if the profile resolved to the default skin. | ||||||
| 1.21.11 | 25w41a | Added minecraft:damage_type, minecraft:kinetic_weapon, minecraft:minimum_attack_charge, minecraft:piercing_weapon, minecraft:swing_animation and minecraft:use_effects item components.
| |||||
minecraft:consumable: The animation field has been updated.
| |||||||
minecraft:intangible: Items with this component now show information about it in their tooltip. | |||||||
| 25w42a | minecraft:kinetic_weapon: Added new field, contact_cooldown_ticks. | ||||||
| 25w45a | minecraft:piercing_weapon and minecraft:kinetic_weapon data components now have bounds on their reach parameters. | ||||||
| 25w46a | Added food properties to the following fish bucket items: minecraft:cod_bucket, minecraft:salmon_bucket, minecraft:pufferfish_bucket, and minecraft:tropical_fish_bucket. | ||||||
minecraft:use_effects: added field interact_vibrations. | |||||||
| pre1 | min_reach, max_reach and hitbox_margin have been moved from minecraft:piercing_weapon and minecraft:kinetic_weapon into a new component minecraft:attack_range to allow all melee weapon types to use them. | ||||||
| pre4 | minecraft:attack_range: Added fields min_creative_reach and max_creative_reach. | ||||||
| 26.1 | snap1 | Added minecraft:additional_trade_cost. | |||||
| snap5 | Added minecraft:dye. | ||||||
| pre1 | minecraft:provides_banner_patterns: The component now also accepts an ID or a list of IDs in addition to a tag. | ||||||
minecraft:blocks_attacks: The field bypassed_by now also accepts an ID or a list of IDs in addition to a tag. | |||||||
minecraft:damage_resistant: The field types now also accepts an ID or a list of IDs in addition to a tag. | |||||||
| 26.2 | snap1 | Added sulfur_cube_content component. | |||||
| 26.3 | snap1 | Added minecraft:provides_pottery_pattern component. | |||||
minecraft:pot_decorations: Instead of taking a list of 4 item IDs, this component now takes an object with 4 optional item stack field. | |||||||
minecraft:trim_material: The format of inline material definitions has been updated.
| |||||||
minecraft:instrument: The format of elements in the instrument registry have been updated. | |||||||
| snap2 | Added minecraft:block_transformer. | ||||||
| snap3 | Added minecraft:compostable. | ||||||
minecraft:block_transformer: Added optional boolean field update_from_neighbors. | |||||||
| snap4 | Added minecraft:cooking_fuel, minecraft:brewing_fuel, minecraft:sign_text_front, minecraft:sign_text_back, minecraft:waxed, minecraft:cushion/color, minecraft:villager_food, and minecraft:mob_visibility components. | ||||||
| snap6 | minecraft:cooking_fuel: burn_time and speed_multiplier can now additionally be defined by an inline number. | ||||||
minecraft:brewing_fuel: uses and speed_multiplier can now additionally be defined by an inline number. | |||||||
minecraft:compostable: layers can now additionally be defined by an inline number. | |||||||
| snap7 | Added minecraft:attack_animation and minecraft:interact_animation. | ||||||
Removed minecraft:swing_animation and minecraft:map_color. | |||||||
| snap10 | Re-added the none swing animation type. | ||||||
minecraft:consumable: Added a new optional field to the teleport_randomly consume effect: directional_particles | |||||||
minecraft:block_transformer: Must now always refer to new block transformer registry. Can no longer be defined inline. | |||||||
minecraft:attack_animation and minecraft:interact_animation: The duration field is now a non-negative integer. | |||||||
| Upcoming Java Edition | |||||||
| 26.4 | snap5 | minecraft:consumable and minecraft:equippable: The sound fields are now fully optional. | |||||
Notes
[edit | edit source]- ↑ 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.
- ↑ 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.
- ↑ 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).
- ↑ 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
dyed_color=0x000000shows "#000000" butdyed_color=[0,0,0]shows "#FF000000" despite them both representing the same pure black RGB color. - ↑ If the item type has special dispenser behavior, this has no effect.
- ↑ 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. - ↑ To be used in the built-in smithing recipes, the item must also be in the
#trim_materialtag.