Data component format

From Minecraft Wiki
Jump to navigation Jump to search
This article is about the format in Java Edition. For the legacy format, see Item format/Before 1.20.5. For the format in Bedrock Edition, see Item components.
"Component" redirects here. For the text format, see Text component format.
This feature is exclusive to Java Edition.
 

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. Not all characteristics of items are covered by data components. For properties of items that are defined by code and cannot be modified through components, see 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, however 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]
For the legacy format before 1.20.5, see Item format/Before 1.20.5.

Every item type (item ID) has a set of default data components. Item stacks must specify an item ID, which implicity sets these default components, but they may be overriden by that individual item stack. Default components are not saved on individual item stacks.

When saved in the NBT format, items are written as a compound with the following tags:

  • [NBT Compound / JSON Object] The root tag.
    • [String] id: The resource location 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.
    • [NBT Compound / JSON Object] components: Optional map of additional (non-default) data components.

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]
Main article: Block entity format

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 transfering data between items and blocks. For example, the Items field in a chest is interpreted as the minecraft:container component, despite being labeled and structured differently.

  • [NBT Compound / JSON Object] The root tag.
    • [String] id: Block entity ID
    • [Boolean] keepPacked: 1 or 0 (true/false) - If true, this is an invalid block entity, and this block is not immediately placed when a loaded chunk is loaded. If false, 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_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_range and max_range when checking for valid distance if item is used by a mob. Defaults to 1.0, valid from 0.0 to 2.0.

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, or saddle. Defaults to any. Note: any refers to any equipment slot, not any inventory slot.
        • [String] operation: Modifier operation. Can be add_value, add_multiplied_base, or add_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, hidden or override.
          • [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.

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.
[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_color component is not specified, then white is used as the base banner color.
      • [NBT Compound / JSON Object]: A single pattern.

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_patterns is specified, then the shield model will show its normal wooden texture. If the minecraft:banner_patterns component 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 to green, the name will be "Green Shield").

Example: /give @s shield[base_color="lime"]

  • Gives a lime shield.
  • [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_contents components. 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 id tag. If the id is not minecraft:bee then the entity will never leave the hive. The Passengers, Pos, Rotation, and UUID tags 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).
        • [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.

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 id tag. Excludes x, y, z, components and keepPacked tags.

Example: /give @s spawner[block_entity_data={id:"mob_spawner",SpawnData:{entity:{id:"spider"}}}]

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_level property 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".

Example: /give @s bamboo_slab[block_state={type:"top"}]

  • Gives a bamboo slab that is always placed in the top half of the block.

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:weapon component). If set to 0, this item can never be disabled by attacks. Defaults to 1.
      • [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.
      • [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.
      • [String][NBT Compound / JSON Object] block_sound: One sound event (an [String] ID, or a new [NBT Compound / JSON Object] sound event definition) to play when an attack is successfully blocked. Defaults to none.
      • [String][NBT Compound / JSON Object] disabled_sound: One sound event (an [String] ID, or a new [NBT Compound / JSON Object] sound event definition) to play when the item goes on its disabled cooldown due to an attack. Defaults to none.
      • [String] bypassed_by: a damage type tag with # of damage types that bypass the blocking. Defaults to none.


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 sound event (an [String] ID, or a new [NBT Compound / JSON Object] 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.

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 NoAI entity tag for all bucketable entities.
      • [Boolean] Silent: Turns into Silent entity tag for all bucketable entities.
      • [Boolean] NoGravity: Turns into NoGravity entity tag for all bucketable entities.
      • [Boolean] Glowing: Turns into Glowing entity tag for all bucketable entities.
      • [Boolean] Invulnerable: Turns into Invulnerable entity tag for all bucketable entities.
      • [Boolean] AgeLocked[upcoming JE 26.1]: Turns into AgeLocked entity tag for axolotls and tadpoles.
      • [Float] Health: Turns into Health entity tag for all bucketable entities.
      • [Int] Age: Turns into Age entity tag for axolotls and tadpoles.
      • [Long] HuntingCooldown: Turns into the expiry time of the memory module has_hunting_cooldown for axolotls.

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 other than a bundle does nothing. 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.
        • [String][NBT List / JSON Array] blocks: Can be a block ID or a block tag with a #, or a list of block IDs. If a single item ID is specified, its default translated name will be shown in the tooltip. If multiple block IDs, a block tag, or no block ID is specified then it will be listed as "Unknown" in the tooltip.
        • [NBT Compound / JSON Object] nbt: Block entity NBT to match. See Block entity format.
        • [NBT Compound / JSON Object] state: The block state properties to match.
          • [String] <block state>: A key-value pair, where the key is a block state key and the value is a block state value to match, for example facing: "east".

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.
      • [NBT Compound / JSON Object]: A single block predicate.
        • [String][NBT List / JSON Array] blocks: Can be a block ID or a block tag with a #, or a list of block IDs. If a single item ID is specified, its default translated name will be shown in the tooltip. If multiple block IDs, a block tag, or no block ID is specified then it will be listed as "Unknown" in the tooltip.
        • [NBT Compound / JSON Object] nbt: Block entity NBT to match. See Block entity format.
        • [NBT Compound / JSON Object] state: The block state properties to match.
          • [String] <block state>: A key-value pair, where the key is a block state key and the value is a block state value to match, for example facing: "east".

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: N x [<name>]". If not present, this crossbow is not charged.

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.

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_amplifier or suspicious_stew_effects components are also present on this item, consuming it applies the stats and effects of those components.
  • If the food 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: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, or trident. Defaults to eat.
      • [String][NBT Compound / JSON Object] sound: One sound event (an [String] ID, or a new [NBT Compound / JSON Object] sound event definition) used during and on completion of the item's consumption. Defaults to entity.generic.eat.
      • [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.

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.
        • [Int] slot: A slot in this container. Can be from 0 to 255 (inclusive).

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.

Example: /give @s chest[container_loot={loot_table:"chests/desert_pyramid"}]

  • Gives a chest that contains the desert pyramid loot when opened.

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.

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_dispatch model type. Missing values return the fallback model.
      • [Byte Array] flags: A list of [Boolean] booleans for the condition model type. Missing value returns the is_false model.
      • [NBT List / JSON Array] strings: A list of [String] strings for the select model type. Missing value returns the fallback model.
      • [NBT List / JSON Array][Int Array] colors: A list of RGB values for the model model type's tints. Missing values return the default value 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 + Blue
          An 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.

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 colors list 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.

  • [NBT Compound / JSON Object] components: Parent tag.
    • [String][NBT List / JSON Array][NBT Compound / JSON Object] minecraft:custom_name: Text component to use as this item, block, or entity's name. 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 appear as a name tag when the entity's hitbox is hovered over by the player. 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. See Text component format.

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.

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.

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.

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 when did so, 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".

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 west and the candle block state property set to lit.
This section describes content that is currently in development for Java Edition.
 
This content has appeared in development versions for Java Edition 26.1, but the full update adding it has not been released yet.
  • [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, or black.

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 color applied of this leather armor or wolf armor item. More generally, it is used as the minecraft:dye color provider in item model definitions. If present on an item, a gray and italic "Dyed" text is added to the tooltip (If you have "Advanced tooltips" on, you will see it an non-italic "Color: #<hex color code>" instead). Color codes are the hex code of the color converted to a decimal number, or can be calculated from the red, green and blue components using this formula:
      (
       Red
      << 16) + (
       Green
      << 8) +
       Blue
      [note 1]
      An 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: Another format. A list containing 3 floats corresponding to red, green and blue values as a fraction (ranged 0 to 1, inclusive) that is automatically converted to the int format.

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:enchantments are 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.

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. When false, this item does not display a glint, even with enchantments.

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:enchantable must 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 is common or uncommon, and light purple if its rarity is rare or epic. 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_order enchantment tag.
      • [Int] <enchantment ID>: A single key-value pair, where the key is the resource location of an enchantment, and the value is the level.

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. Depending on the entity type that this item spawns, and the 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 using it may result in command execution.
      • See Entity format. Must include id tag. Excludes UUID and Passengers.

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, or saddle
      • [String][NBT Compound / JSON Object] equip_sound: One sound event (an [String] ID, or a new [NBT Compound / JSON Object] sound event definition) to play when the item is equipped. Defaults to item.armor.equip_generic.
      • [String] asset_id: The resource location 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 2] 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 resource location of the overlay texture to use when equipped. The directory this refers to is assets/<namespace>/textures/<id>. Assets which do not exist will use the 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. Defaults to false.
      • [String][NBT Compound / JSON Object] shearing_sound: One sound event (an [String] ID, or a new [NBT Compound / JSON Object] sound event definition) to play when the item is sheared. Defaults to item.shears.snip.

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, or burst.
      • [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).

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, or burst.
          • [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).

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 to false.

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 players to glide (as with elytra) when equipped.

Example: /give @s nether_star[equippable={slot:"head"},glider={}]

  • Gives a nether star that can be equipped in the head slot and if on the head, 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.

      There are actually two unique states of this component that both register in usage as the minecraft:ponder_goat_horn instrument ID, but they do not stack with each other, only one of them matches a component comparison for that ID, and only one of them gets serialised while the other does not. This "ghost" Ponder goat horn instrument is only accessible as the default instrument component of the goat_horn item.​[until 26.1]

      • [NBT Compound / JSON Object] description: A text component that is used as a description in tooltips.
      • [String][NBT Compound / JSON Object] sound_event: One sound event (an [String] ID, or a new [NBT Compound / JSON Object] sound event definition)
      • [Float] use_duration: A non-negative float for how long the use duration is.
      • [Float] range: A non-negative float for the range of the sound.

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.

item_model

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [String] minecraft:item_model: The resource location of the item, which references the item model definition /assets/<namespace>/items/<id> without the .json suffix. Referencing nonexistent models will cause the missing model to be used, rather than falling back to the item ID's default model.

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. See Text component format. Unlike the minecraft:custom_name component, this name cannot be erased using an anvil, is not italicized, and does not appear in some labels, such as banner markers and item frames.

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

Example: /give @s amethyst_shard[kinetic_weapon={forward_movement:0.0,delay_ticks:20,damage_conditions:{max_duration_ticks:60},knockback_conditions:{max_duration_ticks:40},dismount_conditions:{max_duration_ticks:20},hit_sound:"block.amethyst_cluster.step"}]

  • Gives an amethyst shard which can perform a charge attack after a 1-second delay. The attack can damage entities for 3 seconds, knock them back for the first 2 seconds and dismount them for the first second. Hitting a target with the attack plays an amethyst sound.
  • [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.

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 tracked in 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. If false, the component is kept. Defaults to true.

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
  • [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.

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_color

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [Int] minecraft:map_color: The color code for the minecraft:map_color color provider in item model definitions. Normally used by the minecraft:filled_map item model.

Example: /give @s filled_map[map_color=16711680]

  • Gives a filled map with red markings on item texture.
An interactive widget is being loaded. If this does not work for you, please reload the page or check if JavaScript is working or enabled.

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, or swamp_hut.
        • [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.

map_id

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [Int] minecraft:map_id: The number of this filled map, representing the shared state holding map contents and markers.

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_size if 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. Example damage=0.

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.

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.

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_scale is ignored. If present on an item, information about the mob effect is added to the tooltip, in the same format as the minecraft:potion_contents component.

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.

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 List / JSON Array] minecraft:pot_decorations: A list of the items (typically pottery sherds or bricks) applied on each face of this decorated pot. If the list is specified with less than 4 entries, the remaining ones default to "minecraft:brick". The first entry is the front face of the pot, and subsequent entries are the faces going clockwise around the pot. If this component is present on an item, the item's tooltip will list the translated names of each of the items in the same order.
      • [String]: The ID of an item. Can be either brick or a sherd.

Example: /give @s decorated_pot[pot_decorations=["skull_pottery_sherd","heart_pottery_sherd","blade_pottery_sherd","brick"]]

  • Gives a decorated pot with sherds: skull, heart and blade on its faces

potion_contents

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.


An interactive widget is being loaded. If this does not work for you, please reload the page or check if JavaScript is working or enabled.

potion_duration_scale

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.

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 with a maximum length of 16, and only consisting of username-allowed characters​[more information needed]. 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, a random default skin is provided. 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] texture: Namespaced path to a player skin texture, relative to the textures folder 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 textures folder 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 textures folder 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, a slim model type is used. Optional.

Example: /give @p player_head[profile=MinecraftWiki]

  • Gives a player head of MinecraftWiki.
An interactive widget is being loaded. If this does not work for you, please reload the page or check if JavaScript is working or enabled.

provides_banner_patterns

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [String] minecraft:provides_banner_patterns: When present, this item can be placed in the pattern slot of a loom and provides the specified banner pattern tag. Must be a tag prefixed 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_trim_material

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [String] minecraft:provides_trim_material: When present, this item provides the specified trim material when used in a trimming recipe.[note 4]

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, or epic. If this component does not exist on the item, then common is used.

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.

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.

Example: /give @p diamond_sword[repairable={items:"stick"}]

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

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_order enchantment tag.
      • [Int] <enchantment ID>: A single key-value pair, where the key is the resource location of an enchantment, and the value is the level.

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_scale is 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.

swing_animation

[edit | edit source]
  • [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 to whack.
      • [Int] duration: A positive integer that determines the animation's duration in ticks. Defaults to 6.
  • [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.

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.

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 resource location 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.
  • [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] pattern: The ID of the trim pattern.
      • [String] material: The ID of the trim material, which applies a color to the trim.

Example: /give @p minecraft:leather_leggings[trim={"pattern":"host","material":"emerald"}] 1

unbreakable

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [NBT Compound / JSON Object] minecraft:unbreakable: If set, this item cannot lose durability, and blue "Unbreakable" text will appear in the item's tooltip.

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 resource location to identify this cooldown group. If present, the item is included in a use cooldown group and no longer shares cooldowns with its base item type, but instead with any other items that are part of the same use cooldown group. Optional.

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

use_effects

[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_start and minecraft:item_interact_finish game events. Defaults to true.

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.

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

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.

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_book does nothing. If this component is removed from a writable_book item, attempting to use the item will still swing the arm and increment its used statistic, but no UI will appear.
      • [NBT List / JSON Array] pages: A list of the pages in the book.
        • [String][NBT Compound / JSON Object] title: The title of this written book. 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.

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_book does nothing except add text to the item tooltip. If this component is removed from a written_book item, attempting to use the item will still swing the arm and increment its used statistic, 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 raw or filtered tags 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.
      • [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. If false, 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's Book tag by a command. Defaults to false.

Entity variant components

[edit | edit source]
This section is a work in progress.
 
Please help expand and improve it. The talk page may contain suggestions.
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

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [String] minecraft:axolotl/variant: lucy, wild, gold, cyan, or blue — The variant of the axolotl

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

fox/variant

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [String] minecraft:fox/variant: red or snow — The variant of the fox

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, or dark_brown — The variant of the horse

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, or gray — The variant of the llama

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: red or brown — The variant of the mooshroom

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.

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, or gray — The variant of the parrot

Example: /give @s parrot_spawn_egg[parrot/variant="blue"]

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

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, or evil — The variant of the rabbit

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

Example: /give @s salmon_spawn_egg[salmon/size="large"]

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

sheep/color

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [String] minecraft:sheep/color: A dye color — The color of the wool of the sheep

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]
  • [NBT Compound / JSON Object] components: Parent tag.

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.

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, or clayfish — The pattern of the tropical fish

tropical_fish/pattern_color

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.

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, or taiga — The variant of the villager

Example: /give @s villager_spawn_egg[villager/variant="desert"]

  • Gives a villager spawn egg that spawns a desert villager.

wolf/collar

[edit | edit source]
  • [NBT Compound / JSON Object] components: Parent tag.
    • [String] minecraft:wolf/collar: A dye color — The color of the collar of the wolf

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.

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.

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.

additional_trade_cost

[edit | edit source]
This section describes content that is currently in development for Java Edition.
 
This content has appeared in development versions for Java Edition 26.1, but the full update adding it has not been released yet.
  • [NBT Compound / JSON Object] components: Parent tag.
    • [Int] minecraft:additional_trade_cost: Used on the gives item of a villager trade to add to the count of the wants item.

Exclusive to joke versions

[edit | edit source]

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

History

[edit | edit source]
This section is missing information about: later 26.1 changes
 
Please expand the section to include this information. Further details may exist on the talk page.
Java Edition
1.20.524w09aReplaced [NBT Compound / JSON Object] tag tag and all underlying item-specific tags with data components.
Replaced [Byte] Count with [Int] count.
24w10aRenamed 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.
24w12aAdded 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.
24w13aAdded item_name, and ominous_bottle_amplifier components.
Components with non-default values on block items are now stored on block entities when placed.
24w14aRenamed [String] text to [String] raw in writable_book_content, and written_book_content components.
Pre-Release 1Renamed [Float] saturation_modifier to [Float] saturation in food component.
max_damage, and max_stack_size components can no longer be put together.
1.2124w19acustom_data component can now be defined as a SNBT string.
Added [NBT Compound / JSON Object] using_converts_to in food component.
24w21aAdded jukebox_playable component.
Changed attribute_modifiers component: removed [String] name and [Int Array] uuid fields, added [String] id field.
1.21.224w33aAdded 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.
24w34aAdded 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.
24w36aAdded equippable, item_model, glider and tooltip_style components.
The item_name component is now always present on every item.
24w37aAdded 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.
24w39aThe lock component is now a compound that represents an item predicate.
Pre-Release 1Added [String] camera_overlay in equippable component.
1.21.424w45acustom_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.525w02aAdded 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.
25w04aAdded 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}
25w05aAdded [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.
25w06aAdded chicken/variant entity variant component.
25w08aAdded wolf/sound_variant entity variant component.
1.21.625w15aAdded optional [NBT Compound / JSON Object] display field to attributes_modifiers.
25w16aThe painting/variant component no longer allows inline paining variant definitions.
25w20aAdded optional [Boolean] can_be_sheared and [String][NBT Compound / JSON Object] shearing_sound fields to equippable.
1.21.925w34aPlayer 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 1minecraft: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.1125w41aAdded 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.
25w42aminecraft:kinetic_weapon: Added new field, contact_cooldown_ticks.
25w45aminecraft:piercing_weapon and minecraft:kinetic_weapon data components now have bounds on their reach parameters.
25w46aAdded 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.
pre1min_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.
pre4minecraft:attack_range: Added fields min_creative_reach and max_creative_reach.
Upcoming Java Edition
26.1snap1Added minecraft:additional_trade_cost.
snap5Added minecraft:dye.

Notes

[edit | edit source]
  1. For positive values larger than 0x00FFFFFF, the top byte is ignored. All negative values produce white.
  2. If the item type has special dispenser behavior, this has no effect.
  3. The damage dealt is calculated as floor(relative_speed * damage_multiplier), where relative_speed is 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.
  4. To be used in the built-in smithing recipes, the item must also be in the #trim_material tag.
[edit | edit source]