Skip to content
Java Edition Reference Docs MC:JE 1.21.5 | DP 71 | RP 55

Item Components

Since 1.20.5

Item stack components are system for customising all aspects of an item. It replaces the old NBT system for item customisation.

Content on this page is largely pulled from the official Minecraft patch notes, with light editing and formatting.

  • Item types (e.g. minecraft:stick) hold a set of default components on an item that individual item stacks can override
  • When advanced tooltips are enabled (F3+H), the number of components will be displayed instead of number of tags
  • Default component values for items are now listed in items.json generated in reports directory

Item Syntax

  • Components are specified after the item name in square brackets
    • Components are assigned with an = (e.g. wooden_pickaxe[damage=23])
    • Components are comma-separated (e.g. netherite_hoe[damage=5,repair_cost=2])
  • Component types will be autocompleted, but possible values of them will not
  • Values will however be validated, and the command will fail to parse if the component is improperly specified
    • e.g. /give @s wooden_pickaxe[damage=-34] is not valid
  • The previous NBT syntax ({...}) has been removed, and replaced with custom_data assignment
    • e.g. /give @s stick{foo:'bar'} becomes /give @s stick[custom_data={foo:'bar'}]
  • Many items have default implicit components. If you wish to remove these, add a bang (!) followed by the name of the component you wish to remove:

Components on block entities

Non-default components on item stacks containing block items are now stored on block entities when placed.

  • Component removals from defaults are currently not preserved
  • Placing and breaking non-block entity blocks remains unchanged - nothing is preserved
  • Does not automatically cause preserved components to be restored on drops - this requires addition of copy_components function to loot table
  • Components are stored in field called components
    • Some components (like custom_name) are still handled by legacy serialization, which means they might not be present in there
    • Contains map of component id to component value

Crafting

Most recipe types now accept components for the result item stack. This enables the long-requested ‘NBT crafting’.

components is allowed on result for these recipe types:

  • crafting_shaped
  • crafting_shapeless
  • stonecutting
  • smithing_transform
  • smelting
  • blasting
  • smoking
  • campfire_cooking

When crafting_transmute is used, the item type changes but all item components are preserved.

Example: crafting an enchanted potato

{
"type": "minecraft:crafting_shapeless",
"ingredients": ["minecraft:stick", "minecraft:cherry_sapling"],
"result": {
"id": "minecraft:poisonous_potato",
"components": {
"minecraft:enchantments": {
"minecraft:knockback": 255
}
}
}
}

Component types

Entity variant components Since 1.21.5

  • Entities have a set of components for configuring variants and other aspects of appearance
  • If those components are present on spawning item (like spawn eggs, mob buckets, minecraft:painting, minecraft:item_frame), they will be applied to new entity
  • Mob buckets and paintings available in creative menu use variants instead of minecraft:entity_data component
  • Custom tooltips for Bucket of Tropical Fish and Painting items are now based on new components instead of minecraft:bucket_entity_data and minecraft:entity_data
  • villager/variant: one of desert, jungle, plains, savanna, snow, swamp, or taiga
  • wolf/variant: namespaced id from the wolf_variant registry
  • wolf/sound_variant: namespaced id from wolf_sound_variant registry
  • wolf/collar: one of 16 dye colors
  • cat/variant: namespaced id from cat_variant registry
  • cat/collar: one of 16 dye colors
  • fox/variant: red or snow
  • parrot/variant: one of red_blue, blue, green, yellow_blue, or gray
  • salmon/size: one of small, medium, or large
  • tropical_fish/pattern: one of kob, sunstreak, snooper, dasher, brinely, spotty, flopper, stripey, glitter, blockfish, betty, or clayfish
  • tropical_fish/base_color: one of 16 dye colors
  • tropical_fish/pattern_color: one of 16 dye colors
  • mooshroom/variant: red or brown
  • rabbit/variant: one of brown, white, black, white_splotched, gold, salt, or evil
  • pig/variant: namespaced id from the pig_variant registry
  • cow/variant: namespaced id from the cow_variant registry
  • chicken/variant: namespaced id from the chicken_variant registry
  • frog/variant: namespaced id from the frog_variant registry
  • horse/variant: one of white, creamy, chestnut, brown, black, gray, or dark_brown
  • llama/variant: one of creamy, white, brown, or gray
  • axolotl/variant: one of lucy, wild, gold, cyan, or blue
  • painting/variant: namespaced id from painting_variant registry
  • sheep/color: one of 16 dye colors
  • shulker/color: one of 16 dye colors

minecraft:custom_data

  • Can be used for custom data storage on an item
  • Since 1.21.5 Can also be applied to entities under the data attribute to store data on them
  • When upgrading a world, any non-game data in the item tag will be moved into here
  • Format: object with any fields
    • e.g. custom_data={some:'data'}
  • Can be modified with the set_custom_data and copy_custom_data loot functions
  • Can be specified as an SNBT string to preserve type information in JSON
    • This is the same as is used in the set_custom_data loot function and custom_data predicate

minecraft:damage

  • The amount of durability removed from an item
  • If removed, the item will not be damageable
  • Format: non-negative integer
    • e.g. damage=12
  • For damageable items (with the max_damage component), has an implicit default value of: 0
  • Can be modified with the set_damage loot function

minecraft:repair_cost

  • The additional experience cost required to modify an item in an Anvil
  • Format: non-negative integer
    • e.g. repair_cost=12
  • If not set, has an implicit default value of: 0

minecraft:unbreakable Changed in 1.21.5

  • If set, the item will not lose any durability when used
  • Format: empty object
    • e.g. unbreakable={}
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:enchantments Changed in 1.21.5

  • Stores a list of enchantments and their levels on an item
  • Format: object of enchantment (id string) to level (integer 0-255)
    • e.g. enchantments={'minecraft:protection':2} or enchantments={sharpness:1}
  • Can be modified with the set_enchantments, enchant_randomly, and enchant_with_levels loot functions
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:stored_enchantments Changed in 1.21.5

  • Stores list of enchantments and their levels for an Enchanted Book
  • Unlike minecraft:enchantments, the effects provided by enchantments do not apply from this component
  • Format: object of enchantment (id string) to level (integer 0-255) (same as minecraft:enchantments)
    • e.g. stored_enchantments={'minecraft:protection':2} or stored_enchantments={sharpness:1}
  • On Enchanted Books, has an implicit default value of: {levels:{}}
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:custom_name Changed in 1.21.5

  • Custom name override for an item (as set by renaming with an Anvil)
  • Format: JSON chat component string
    • e.g. custom_name='{"text": "This item is renamed!", "color": "red"}'
  • Can be modified with the set_name loot function
  • Transferred from a spawning item to a spawned entity

minecraft:lore

  • Additional lines to include in an item’s tooltip
  • Format: list of JSON chat component strings (max: 256 entries)
    • e.g. lore=['{"text": "The cake is a lie!"}']
  • If not set, has an implicit default value of: []
  • Can be modified with the set_lore loot function

minecraft:can_break Changed in 1.21.5

  • Controls which blocks a player in Adventure mode can break with this item
    • These were previously stored as flat strings, but now use the more flexible block predicate format already used in loot tables and advancements
  • Format: single block predicate or list of block predicates
    • blocks: block, list of blocks, or hash-prefixed block tag
    • nbt: block entity NBT to match
    • state: map of state property key to values to match
    • e.g. can_break=[{blocks:'minecraft:furnace',state:{facing:'north'}}, {blocks:'minecraft:furnace',state:{facing:'west'}}]
    • e.g. can_break={blocks:'minecraft:stone'}
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:can_place_on Changed in 1.21.5

  • Controls which blocks a player in Adventure mode can place on with this item
  • Format: single block predicate or list of block predicates
    • Same as can_break.predicates
    • e.g. can_place_on=[{blocks:'minecraft:furnace',state:{facing:'north'}}, {blocks:'minecraft:furnace',state:{facing:'south'}}] (list format)
    • e.g. can_place_on={blocks:'minecraft:stone'} (single element format)
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:dyed_color Changed in 1.21.5

minecraft:attribute_modifiers Changed in 1.21.5

  • Holds attribute modifiers applied to any item
  • Format: list of attribute modifiers
    • type: an attribute id
    • slot: one of:
      • any (default)
      • hand: either in main or offhand
      • armor: any armour slot
      • mainhand
      • offhand
      • head
      • chest
      • legs
      • feet
      • body
      • Modifiers will only apply when the item is equipped in the specified slot
    • id: This is a unique identifier per attribute for the modifier
    • amount: double, number of units to modify this attribute (controlled by operation)
    • operation: one of:
      • add_value: Adds amount to the attribute
      • add_multiplied_base: Adds amount * base value to the attribute
      • add_multiplied_total: Adds amount * total value (from all previous modifiers) to the attribute
    • e.g. attribute_modifiers=[{type:'generic.scale',id:"big_thing",name:'Big!',amount:1.0,operation:'add_multiplied_base'}]
  • If not set, has an implicit default value based on the item type’s default attributes (e.g. attack damage for weapons)
  • Can be modified with the set_attributes loot function
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:charged_projectiles

  • Holds all projectiles that have been loaded into a Crossbow
  • If not present, the Crossbow is not charged
  • Format: list of item stacks
    • Cannot store empty/air items
    • e.g. charged_projectiles=[{id:'minecraft:arrow'}]
  • Can be modified with the modify_contents and set_contents loot functions

minecraft:intangible_projectile

  • Marks that a projectile item would be intangible when fired (i.e. can only be picked up by a creative mode player)
  • Only set when items are inside a Crossbow’s charged_projectiles component
  • Format: empty object
    • e.g. intangible_projectile={}

minecraft:bundle_contents

  • Holds all items stored inside of a Bundle
  • If removed, items cannot be added to the Bundle
  • Format: list of item stacks
    • Cannot store empty/air items
    • e.g. bundle_contents=[{id:'minecraft:poisonous_potato'}]
  • On Bundles, has an implicit default value of: []
  • Can be modified with the modify_contents and set_contents loot functions

minecraft:map_color

  • Represents the tint of the decorations on the Filled Map item
  • Format: integer, RGB value
    • e.g. map_color=16711680
  • On Filled Maps, has an implicit default value of: 4603950

minecraft:map_decorations

  • Holds a list of markers to be placed on a Filled Map (used for Explorer Maps)
  • Format: map of unique decoration id to decorations
    • type: one of:
      • player
      • frame
      • red_marker
      • blue_marker
      • target_x
      • target_point
      • player_off_map
      • player_off_limits
      • mansion
      • monument
      • banner_white
      • banner_orange
      • banner_magenta
      • banner_light_blue
      • banner_yellow
      • banner_lime
      • banner_pink
      • banner_gray
      • banner_light_gray
      • banner_cyan
      • banner_purple
      • banner_blue
      • banner_brown
      • banner_green
      • banner_red
      • banner_black
      • red_x
      • village_desert
      • village_plains
      • village_savanna
      • village_snowy
      • village_taiga
      • jungle_temple
      • swamp_hut
      • trial_chambers
    • x: double, world coordinate
    • z: double, world coordinate
    • rotation: float, clockwise rotation from north in degrees
    • e.g. map_decorations={'Some marker':{type:'target_x',x:123.0,z:-45.0,rotation:0.0f}}
  • On Filled Maps, has an implicit default value of: {}

minecraft:map_id

  • References the shared map state holding map contents and markers for a Filled Map
  • Format: integer id
    • e.g. map_id=1

minecraft:custom_model_data Changed in 1.21.4

minecraft:potion_contents Changed in 1.21.5

  • Holds the contents of a potion (Potion, Splash Potion, Lingering Potion), or potion applied to an item (Tipped Arrow)
  • Cam be applied by eating an item with the minecraft:consumable component
  • Format: object with fields
    • potion: potion id (optional)
      • The potion type in this item: the item will inherit all effects from this
      • A list of IDs is available at the bottom of the item data section of the potions wiki page
    • custom_color: integer, RGB value (optional)
      • Overrides the visual color of the potion
    • custom_effects: list of effect instances (default: [])
      • Additional list of custom effects that this item should apply, that may not be representable by an existing potion
    • custom_name: string (optional)
      • When present, used to generate containing stack name
      • E.g. if the value is foo and the item is minecraft:lingering_potion, the name of item will be translation of item.minecraft.lingering_potion.effect.foo
    • e.g. potion_contents={potion:'minecraft:invisibility',custom_color:16711680}
    • Alternatively, can be defined as a single potion ID
      • e.g. potion_contents="invisibility"
  • On Potion or Tipped Arrow items, has an implicit default value of: {}
  • Can be modified with the set_potion loot function
  • Transferred from a spawning Lingering Potion to a spawned Area Effect Cloud

minecraft:potion_duration_scale Since 1.21.5

  • When present, for items that have the minecraft:potion_contents component, the duration of the applied effects will be scaled by this factor
  • This also applies to custom_effects in the minecraft:potion_contents component, unlike the previous hardcoded scaling factor
  • If not specified, defaults to 1.0
  • Format: non-negative float
  • e.g. potion_duration_scale=0.25
  • Transferred from a spawning Lingering Potion to a spawned Area Effect Cloud

minecraft:writable_book_content

  • Holds the contents in a Book and Quill
  • Format: object with fields
    • pages: list (max: 100 entries) of either:
      • object with fields
        • raw: string, page plain text contents
        • filtered: string, filtered page contents (optional)
          • If specified, players with chat filter enabled will see this page instead of raw
      • or: string, page plain text contents
    • e.g. writable_book_content={pages:['Hello world!']} or writable_book_content={pages:[{raw:'Hello world!'}]}
  • On Book and Quill, has an implicit default value of: {pages:[]}
  • Can be modified with the set_writable_book_pages loot function

minecraft:written_book_content

  • Holds the contents and metadata of a Written Book
  • Format: object with fields
    • pages: list of filtered chat components
      • Same format as writable_book_contents pages, except uses JSON chat component strings which can be formatted
    • title: filtered string (same format as pages)
    • author: string, player name
    • generation: integer [0; 3]
      • The number of times this book has been copied (0 = original)
    • resolved: boolean
      • true if the chat components in this book have already been resolved (entity selectors, scores substituted)
      • If false, it will be resolved when opened by a player
    • e.g. written_book_content={pages:['"Hello world!"'],title:{raw:'"A delightful read"'},author:'Herobrine',generation:1,resolved:true}
  • Can be modified with the set_written_book_pages and set_book_cover loot functions

minecraft:trim Changed in 1.21.5

  • Holds the trims applied to an item
  • Format: object with fields
    • pattern: pattern id (or inline pattern)
    • material: material id (or inline material)
    • e.g. trim={pattern:'minecraft:silence',material:'minecraft:redstone'}
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:suspicious_stew

  • Holds the effects that will be applied when consuming Suspicious Stew with the minecraft:consumable component
  • Format: list of effect objects with fields
    • id: effect id
    • duration: integer, tick count (default: 160)
    • e.g. suspicious_stew=[{id:'minecraft:poison'}]
  • On Suspicious Stew, has an implicit default value of: []
  • Can be modified with the set_stew_effect loot function

minecraft:debug_stick_state

  • Stores the selected block state properties used by a Debug Stick
  • Format: map of block id to block property name
    • e.g. debug_stick_state={'minecraft:turtle_egg':'eggs','minecraft:furnace':'facing'}
  • On Debug Stick, has an implicit default value of: {}

minecraft:entity_data

  • Stores unstructured NBT data to apply to an entity when using an item that spawns an entity, such as a Spawn Egg or Armor Stand
  • Format: object with fields
    • Must contain an id field with the entity type
    • Any additional fields will be merged into the entity when spawned
    • e.g. entity_data={id:'minecraft:pig',Health:1.0f}

minecraft:bucket_entity_data

  • Stores unstructured NBT data to apply to an entity when placed from a bucket
  • Format: object with fields
    • Can contain any of the above listed fields, which will be applied to the entity when placed
    • e.g. bucket_entity_data={NoAI:1,Age:43}
  • On bucketed mob items, has an implicit default value of: {}

minecraft:instrument

  • Holds the instrument type used by a Goat Horn
  • Format: instrument id
    • e.g. instrument='minecraft:ponder_goat_horn'
  • Can be modified with the set_instrument loot function

minecraft:recipes

  • List of recipes that should be unlocked when using the Knowledge Book item
  • Format: list of recipe ids
    • e.g. recipes=['minecraft:acacia_boat','minecraft:anvil']
  • On Knowledge Book, has an implicit default value of: []

minecraft:lodestone_tracker

  • If present, specifies that the Compass is a Lodestone Compass
  • Format: object with fields
    • target: object with fields (optional)
      • pos: integer array of x, y, and z
      • dimension: dimension id
      • If not present, the compass will spin
    • tracked: boolean (default: true)
      • If true, when the Lodestone at the target position is removed, the target field will be removed
    • e.g. lodestone_tracker={target:{pos:[13,64,-43],dimension:'minecraft:the_nether'}}

minecraft:firework_explosion

  • Stores the explosion crafted in a Firework Star
  • Format: object with fields
    • shape: one of
      • small_ball
      • large_ball
      • star
      • creeper
      • burst
    • colors: integer array, RGB values (default: [])
      • List of initial particle colors, randomly selected from
    • fade_colors: integer array, RGB values (default: [])
      • List of particle colors to fade to, randomly selected from
    • has_trail: boolean (default: false)
    • has_twinkle: boolean (default: false)
      • Renamed from Flicker tag
    • e.g. firework_explosion={shape:'large_ball',colors:[16711680],has_trail:true}
  • Can be modified with the set_firework_explosion loot function

minecraft:fireworks

  • Stores all explosions crafted into a Firework Rocket, as well as flight duration
  • Format: object with fields
    • explosions: list of explosions (max: 256 entries)
    • flight_duration: unsigned byte, number of gunpowder in this rocket
    • e.g. fireworks={explosions:[{shape:'large_ball',colors:[16711680],has_trail:true}],flight_duration:2}
  • On Firework Rocket, has an implicit default value of: {explosions:[],flight_duration:1}
  • Can be modified with the set_fireworks loot function

minecraft:profile

  • Controls the skin displayed on a Player Head
  • Copied to Player Head block when placed
  • If only a name is specified, it will be resolved into the corresponding player ID and skin data
  • Unlike SkullOwner which only supported resolution by name, if only id is specified, the profile and skin will be resolved from this UUID
  • Format: object with fields
    • name: string, player profile name (optional)
      • Must be a valid player name (max 16 characters, no spaces, or special characters)
      • As this could exist in previous data formats, but would not resolve to a skin, this is replaced by the item_name component which is persisted when placed and broken
    • id: uuid, player profile id (optional)
    • properties: list of properties (optional)
      • name: string, property name (e.g. textures)
      • value: string (base64 encoded texture data)
      • signature: string (optional)
    • e.g. profile={name:'MHF_Sheep'}
    • Alternatively, can be defined as a simple player profile name string
      • e.g. profile='MHF_Sheep'
  • Can be modified with the fill_player_head loot function

minecraft:note_block_sound

  • Controls the sound played by a Player Head when placed on a Note Block
  • Copied to Player Head block when placed
  • Format: sound event id
    • e.g. note_block_sound='minecraft:ambient.cave'

minecraft:base_color

  • Stores the base color for a Shield
  • Format: one of 16 predefined colours, such as magenta
  • e.g. base_color='magenta'

minecraft:banner_patterns

  • Stores the additional patterns applied to a Banner or Shield
  • Copied to Banner block when placed
  • Format: list of banner patterns
    • pattern: banner pattern registry id
    • color: dye color name
    • e.g. banner_patterns=[{pattern:'minecraft:stripe_top',color:'red'}]
  • On Banners and Shields, has an implicit default value of: []
  • Can be modified with the set_banner_pattern loot function

minecraft:pot_decorations

  • Stores the Sherds applied to each side of a Decorated Pot
  • Copied to Decorated Pot block when placed
  • Format: list of sherd item ids
    • e.g.
      ['arms_up_pottery_sherd','angler_pottery_sherd','danger_pottery_sherd','shelter_pottery_sherd']
  • On Decorated Pots, has an implicit default value of: ['minecraft:brick','minecraft:brick','minecraft:brick','minecraft:brick']

minecraft:container

  • Holds the contents of container blocks (Chests, Shulker Boxes) in item form
  • Copied into container block when placed
  • Format: list of slots
    • slot: integer [0; 255], representing a slot in the container
    • item: item stack
    • e.g. container=[{slot:7,item:{id:'diamond_pickaxe',components:{'minecraft:unbreakable':{}}}}]
  • On container blocks, has an implicit default value of: []
  • Can be modified with the modify_contents and set_contents loot functions

minecraft:bees

  • Holds the bees inside a Beehive or Bee Nest
  • Copied to Beehive or Bee Nest block when placed
  • Format: list of bees
    • entity_data: map of string to string
      • id: entity id
      • The remainder tags merged into the Bee when spawned
    • ticks_in_hive: integer
    • min_ticks_in_hive: integer
    • e.g: bees=[{entity_data:{id='minecraft:bee'},ticks_in_hive:3,min_ticks_in_hive:10}]
  • On Beehive and Bee Nest, has an implicit default value of: []

minecraft:lock

  • Holds the lock state of a container-like block
    • An item with a custom name of the same value must be used to open this container
  • Copied to container block when placed
  • Format: string value, representing the key
    • e.g: lock='hunter2'

minecraft:container_loot

  • Holds the unresolved loot table and seed of a container-like block
  • Copied to container block when placed
  • Format: object with fields
    • loot_table: loot table id
    • seed: long, pseudorandom seed to resolve the loot table with (optional)
      • If not specified, or 0, the seed will be picked randomly when the loot table is evaluated
    • e.g. container_loot={loot_table:'minecraft:chests/buried_treasure',seed:123}
  • Can be modified with the set_loot_table loot function

minecraft:block_entity_data Changed in 1.21.4

  • Stores unstructured NBT data to apply to a block entity when placing a block such as a Chest or Furnace
  • Any block entity data moved into a dedicated item component is removed from this tag
  • Item blocks with this component only set block entity data only if id tag matches type of placed block entity
    • Additionally, a warning will be added to item tooltip if placing such item might directly or indirectly lead to command execution with high permission level. This cannot be hidden by any other component.
  • For Command Blocks, Lecterns, Signs, and Spawners: this tag will not be copied unless the player is an operator
  • Format: object with fields
    • Must contain an id field with the block entity type
    • Any additional fields will be merged into the block entity when placed
    • e.g. block_entity_data={id:'minecraft:chest',Items:[{Slot:1,item:'minecraft:diamond'}]}

minecraft:block_state

  • Holds block state properties to apply when placing a block
  • Format: map of property key to property value
    • All property values, including integer and boolean types, must be represented as strings
    • e.g: block_state={eggs:'10'}

minecraft:enchantment_glint_override

  • Overrides the enchantment glint effect on an item
  • Can be used in the same way that an invalid Enchantments tag would previously behave to add a glint
  • Format: boolean
    • If true, an item without an enchantment glint will display a glint
    • If false, an item with a glint will not display this glint (either from enchantments or intrinsic properties of the item)
    • e.g: enchantment_glint_override=true

minecraft:food Changed in 1.21.2

  • A data container which only holds the food stats applied when the item is consumed
  • Does not enable the item to be eaten. That requires the minecraft:consumable component.
  • Format: object with fields
    • nutrition: Non-negative integer, the amount of nutrition applied when consumed
    • saturation: Float, the amount of saturation applied when consumed
    • can_always_eat: Boolean (defaul false), whether it can be consumed even when the user is not hungry

minecraft:max_stack_size

  • Controls the maximum stacking size of this item
  • Values greater than 1 are mutually exclusive with the max_damage component
    • This means you need to add a negative !max_damage component to items that implicitly have one
  • Format: integer between 1 and 99
    • e.g. max_stack_size=4
  • Has an implicit default value according to the item type (usually 64)

minecraft:max_damage

  • Controls the maximum amount of damage than an item can take
  • Mutually exclusive with the max_stack_size component greater than 1
    • This means you need to add a negative !max_stack_size component to items that implicitly have one
  • Requires that the damage component is also present on the item
  • If not present, the item cannot be damaged
  • Format: positive integer
    • e.g. max_damage=123
  • Has an implicit default value for damageable items

minecraft:tool

  • Controls the behavior of the item as a tool
  • Format: object with fields
    • rules: list of rule entries to apply in order
      • blocks: single block, list of blocks, or #-prefixed block tag to match
      • speed (optional): float, overrides the mining speed if present and matched
      • correct_for_drops (optional): boolean, overrides whether this tool is considered ‘correct’ if present and matched
        • true will cause the block to mine at its most efficient speed, and drop items if the targeted block requires that
    • default_mining_speed: float, mining speed to use if no rules match and override mining speed (default: 1.0)
    • damage_per_block: non-negative int, amount of durability to remove each time a block is mined with this tool
    • e.g. tool={rules:[{blocks:"#mineable/pickaxe",speed:4.0,correct_for_drops:true}]}
  • Vanilla tool items will have an implicit default value based on their tier and tool type

minecraft:item_name Changed in 1.21.2

  • Always present on every item
  • Name provided by this component always has the lowest priority
  • When present, replaces default item name with contained chat component
  • Differences from custom_name:
    • item_name can’t be changed or removed in Anvil
    • item_name is not styled with italics when displayed to player
    • item_name does not show labels where applicable (for example: banner markers, names in item frames)
  • Can be modified with the set_name loot function

minecraft:damage_resistant Changed in 1.21.2

  • Items with this component, when in entity form, will be resistant to the damage types included in the types tag
  • Format: object with fields
    • types: hash-prefixed damage type tag
  • This component also affects whether the equipped item will be damaged when the wearer is hurt by a given damage type
  • Has an implicit default value for fire-resistant items such as Netherite

minecraft:rarity

  • Controls the color of the item name
  • Format: enumerated value, one of:
    • common (default): white name, or aqua when enchanted
    • uncommon: yellow name, or aqua when enchanted
    • rare: aqua name, or light purple when enchanted
    • epic: light purple name
    • e.g. rarity=rare
  • Special items such as Golden Apples have an implicit default value

minecraft:ominous_bottle_amplifier

  • Controls the amplifier amount for an Ominous Bottle’s Bad Omen effect
  • Cam be applied by eating an item with the minecraft:consumable component
  • Format: integer between 0 and 4
    • e.g. ominous_bottle_amplifier=3
  • Can be modified with the set_ominous_bottle_amplifier loot function

minecraft:jukebox_playable Since 1.21 Changed in 1.21.5

  • If set, the item can be inserted into Jukeboxes to play a song
  • Format: Jukebox song id
    • The song that will be played by the Jukebox when this item stack is inserted
    • e.g. jukebox_playable='minecraft:precipice', jukebox_playable:'minecraft:otherside'
  • To modify the tooltip, see minecraft:tooltip_display

minecraft:consumable Since 1.21.2

  • If present, this item can be consumed on use
  • Format: object with fields
    • consume_seconds: Non-negative float (default 1.6)
      • The amount of seconds it takes for a player to consume the item.
    • animation: The animation used during consumption of the item
      • Default value: eat
      • Accepted values:
        • none (you still need to wait consume_seconds before on_consume_effects)
        • eat
        • drink
        • block
        • bow
        • spear (this is the trident animation)
        • crossbow
        • spyglass
        • toot_horn
        • brush
    • sound: Sound event (default entity.generic.eat)
      • The sound used during and on completion of the item’s consumption
    • has_consume_particles: Boolean (default true),
      • Whether consumption particles are emitted while consuming this item
    • on_consume_effects: An optional list of side effects which take place as a result of consuming this item
      • There are currently 5 valid consume effects, identified by a type field
      • minecraft:apply_effects
        • effects: A list of status effect instances applied once consumed
        • probability: Float (default 1.0)
          • The probability the above effects will be applied once consumed
      • minecraft:remove_effects
        • effects: A set of status effects removed once consumed, as either a Status Effect ID, hash-prefixed tag, or list of IDs
      • minecraft:clear_all_effects
        • Clears all status effects of the consumer
      • minecraft:teleport_randomly
        • diameter: Positive float (default 16.0),
          • The diameter that the consumer will be teleported within
      • minecraft:play_sound
        • sound: Sound event, played once consumed
    • e.g. consumable={consume_seconds:3.0, animation:'eat', sound:'entity.generic.eat', has_consume_particles:true, on_consume_effects:[{type:'minecraft:clear_all_effects'}]}

minecraft:use_remainder Since 1.21.2

  • If present, will replace the item with a remainder if its stack count has decreased after use
    • If the item has a stack count higher than 0 after use, the remainder item will be added to the inventory
    • If the inventory is full when trying to add a remainder item to it, it will be dropped on the ground
  • Format: single value as an item stack
    • e.g. use_remainder={id:'minecraft:stick',count:1}

minecraft:use_cooldown Since 1.21.2

  • If present, this item will apply a cooldown to all items of the same type or “cooldown group” once used
  • Format: object with fields
    • seconds: Positive float, the amount of seconds the cooldown will take place for
    • cooldown_group: Optional namespaced id representing the cooldown group
      • Items with the same cooldown group will share any cooldown applied to another item within that group
      • If not specified, the cooldown group defaults to the base item type’s ID
    • e.g. use_cooldown={seconds:1.5,cooldown_group:"minecraft:custom_weapon"}

minecraft:item_model Since 1.21.2 Changed in 1.21.4

  • Controls item model
  • Present on every item
  • Format: namespaced ID
    • namespace:id will reference model /assets/<namespace>/items/<id>
    • e.g. model for item with item_model=foo:bar is stored in /assets/foo/items/bar.json

minecraft:equippable Since 1.21.2 Changed in 1.21.4

  • If present, this item can be equipped by players in the selected slot
  • Format: object with fields
    • slot: one of head, chest, legs, feet, body, mainhand, or offhand
    • equip_sound (optional): Sound event to play when the item is equipped
      • If not specified, the default armor equip sound will be played
    • asset_id (optional): namespaced ID of the equipment model to use when equipped
      • These model definitions are loaded from Resource Packs
      • If not specified, will fall back to rendering as the item itself when in the head slot (or no rendering if not applicable)
    • camera_overlay (optional): namespaced ID of the overlay texture to use when equipped
      • If not specified, no overlay is used
      • The ID will address a texture under the textures/ folder and automatically assumed to be .png
        • For instance, misc/pumpkinblur addresses textures/misc/pumpkinblur.png
    • allowed_entities (optional): Entity ID, Entity Tag, or list of Entity IDs to limit which entities can equip this item
      • If not specified, any entity (that can wear this kind of equipment) is allowed to equip this item
    • dispensable: boolean (default: true), whether the item can be equipped by using a Dispenser
      • If the item type has special dispenser behavior, this will have no effect
    • swappable: boolean (default: true), whether the item can be equipped into the relevant slot by right-clicking
    • damage_on_hurt: boolean (default: true), whether this item will be damaged when the wearing entity is damaged
    • e.g. equippable={slot:'chest',equip_sound:'item.armor.equip_chain'}

minecraft:glider Since 1.21.2

  • If present, this item will allow players to glide (as with Elytra) when equipped
  • Format: empty object
    • e.g. glider=

minecraft:tooltip_style Since 1.21.2

  • If present, this item can use custom sprites for its tooltip background and frame
  • Format: namespaced ID for a tooltip style
    • A tooltip style of namespace:path will use sprites with IDs:
      • <namespace>:tooltip/<path>_background and <namespace>:tooltip/<path>_frame
    • e.g. tooltip_style='minecraft:special_sword'

minecraft:death_protection Since 1.21.2

  • If present, this item will protect the holder from dying by restoring a single health point
  • Format: object with fields
    • death_effects: An optional list of effects that are applied when the item protects the holder
      • These effects are the same as those specified by the on_consume_effects field in the consumable component

minecraft:repairable Since 1.21.2

  • If present, and this item is damageable, this item can be repaired in an Anvil using the specified ingredient
  • Format: object with fields
    • items: Item, list of Items, or hash-prefixed Item Tag matching what can be used to repair this item
    • e.g. repairable={items:'stick'}

minecraft:enchantable Since 1.21.2

  • If present (and any enchantments are applicable), this item can be enchanted in an Enchanting Table
  • Format: object with fields
    • value: Positive integer, a higher value allows enchantments with a higher cost to be picked
    • e.g. enchantable={value:15}

minecraft:weapon Since 1.21.5

  • When present, the ‘Item Used’ statistic will be incremented for each attack with the item
  • The specified amount of damage can be done to the item with each attack
  • Format: object with fields:
    • item_damage_per_attack: non-negative integer (default: 1)
    • disable_blocking_for_seconds: non-negative float (default: 0)
      • If non-zero, will disable a blocking Shield on successful attack for the specified amount of seconds
    • e.g. weapon={item_damage_per_attack:2}

minecraft:blocks_attacks Since 1.21.5

  • When present, this item can be used like a Shield to block attacks to the holding player

  • Format: object with fields:

    • block_sound: sound event (optional)

      • If specified, this sound will be played when an attack is successfully blocked
    • disable_sound: sound event (optional)

      • If specified, this sound will be played when the item goes on its disabled cooldown due to an attack
    • block_delay_seconds: non-negative float (default: 0)

      • The number of seconds that right-click must be held before successfully blocking attacks
    • disable_cooldown_scale: non-negative float (default: 1)

      • Multiplier applied to the number of seconds that the item will be on cooldown for when attacked by a disabling attack (disable_blocking_for_seconds on the minecraft:weapon component)
      • If 0, this item can never be disabled by attacks
    • bypassed_by: hashtagged damage type tag (optional)

      • If specified, blocking is bypassed by these damage types
    • damage_reductions: list of object with fields (optional)

      • Controls how much damage should be blocked in a given attack

      • If not specified, all damage is blocked

      • Each entry in the list contributes an amount of damage to be blocked, optionally filtered by damage type

      • Each entry adds to blocked damage, determined by clamp(base + factor * dealt_damage, 0, dealt_damage)

      • The final damage applied in the attack to the entity is determined by dealt_damage - clamp(blocked_damage, 0, dealt_damage)

      • Entry format:

        • type: damage type id, list of damage type ids, or hash-prefixed damage type tag (optional)
          • This entry will only contribute to the blocked damage if the dealt damage type matches this field
          • If not specified, any damage type will be accepted
        • base: float
          • Constant amount of damage to be blocked
        • factor: float
          • Fraction of the dealt damage that should be blocked
        • horizontal_blocking_angle: angle in degrees as a positive float (default: 90)
          • The maximum angle between the user’s facing and the incoming attack for the block to be effective
          • If the blocked damage has no position, the compared angle will be assumed to be the maximum 180
        • item_damage: object with fields (optional)
          • Controls how much damage should be applied to the item from a given attack
          • If not specified, a point of durability is removed for every point of damage dealt
          • The final damage applied to the item is determined by: floor(base + factor * dealt_damage)
          • The final value may be negative, causing the item to be repaired
          • Format:
            • threshold: non-negative float
              • The minimum amount of damage dealt by the attack before item damage is applied to the item
            • base: float
              • Constant amount of damage applied to the item, if threshold is passed
            • factor: float
              • Fraction of the dealt damage that should be applied to the item, if threshold is passed

minecraft:break_sound Since 1.21.5

  • When present, this sound will be played when the item runs out of durability and breaks
  • If not present, no sound will be played on break
  • This component is present by default on every item type
  • Format: sound event
    • e.g. break_sound='item.wolf_armor.break'

minecraft:provides_banner_patterns Since 1.21.5

  • When present, this item can be placed in the pattern slot of a Loom
  • Format: hash-prefixed banner pattern tag
    • e.g. provides_banner_patterns='#minecraft:pattern_item/globe'

minecraft:provides_trim_material Since 1.21.5

  • When present, this item will provide the specified trim material when used in a trimming recipe
  • Note that to be used in the built-in smithing recipes, the item must also be in the #trim_material tag
  • As such, the trim material registry definition no longer specifies an item
  • Format: trim material id
    • e.g. provides_trim_material='minecraft:iron'

minecraft:tooltip_display Since 1.21.5

  • This component allows the tooltips provided specifically by any given item component to be suppressed
  • This replaces the previous show_in_tooltip fields, hide_additional_tooltip and hide_tooltip components
  • Format: object with fields:
    • hide_tooltip: boolean (default: false)
      • If true, the item will have no tooltip when hovered
    • hidden_components: list of item component ids (default: ~)
      • The tooltips provided by any component in this list will be hidden
      • If that component provides no tooltip, it will have no effectimport (...args) => { if (!validateArgs(args)) { throw new AstroError({ ...InvalidComponentArgs, message: InvalidComponentArgs.message(name) }); } return cb(...args); } from “@astrojs/starlight/components”;import (...args) => { if (!validateArgs(args)) { throw new AstroError({ ...InvalidComponentArgs, message: InvalidComponentArgs.message(name) }); } return cb(...args); } from “@astrojs/starlight/components”;import (...args) => { if (!validateArgs(args)) { throw new AstroError({ ...InvalidComponentArgs, message: InvalidComponentArgs.message(name) }); } return cb(...args); } from “@astrojs/starlight/components”;