Item Components
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.jsongenerated inreportsdirectory- You can use https://far.ddns.me/item to look up the default components for items
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])
- Components are assigned with an
- 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
- e.g.
- The previous NBT syntax (
{...}) has been removed, and replaced withcustom_dataassignment- e.g.
/give @s stick{foo:'bar'}becomes/give @s stick[custom_data={foo:'bar'}]
- e.g.
- 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:- e.g.
/give @s minecraft:bread[!minecraft:consumable]will give you bread lacking theminecraft:consumablecomponent, so it cannot be eaten
- e.g.
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_componentsfunction 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
- Some components (like
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_shapedcrafting_shapelessstonecuttingsmithing_transformsmeltingblastingsmokingcampfire_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_datacomponent - Custom tooltips for Bucket of Tropical Fish and Painting items are now based on new components instead of
minecraft:bucket_entity_dataandminecraft:entity_data
villager/variant: one ofdesert,jungle,plains,savanna,snow,swamp, ortaigawolf/variant: namespaced id from thewolf_variantregistrywolf/sound_variant: namespaced id fromwolf_sound_variantregistrywolf/collar: one of 16 dye colorscat/variant: namespaced id fromcat_variantregistrycat/collar: one of 16 dye colorsfox/variant:redorsnowparrot/variant: one ofred_blue,blue,green,yellow_blue, orgraysalmon/size: one ofsmall,medium, orlargetropical_fish/pattern: one ofkob,sunstreak,snooper,dasher,brinely,spotty,flopper,stripey,glitter,blockfish,betty, orclayfishtropical_fish/base_color: one of 16 dye colorstropical_fish/pattern_color: one of 16 dye colorsmooshroom/variant:redorbrownrabbit/variant: one ofbrown,white,black,white_splotched,gold,salt, orevilpig/variant: namespaced id from thepig_variantregistrycow/variant: namespaced id from thecow_variantregistrychicken/variant: namespaced id from thechicken_variantregistryfrog/variant: namespaced id from thefrog_variantregistryhorse/variant: one ofwhite,creamy,chestnut,brown,black,gray, ordark_brownllama/variant: one ofcreamy,white,brown, orgrayaxolotl/variant: one oflucy,wild,gold,cyan, orbluepainting/variant: namespaced id frompainting_variantregistrysheep/color: one of 16 dye colorsshulker/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
dataattribute to store data on them - When upgrading a world, any non-game data in the item
tagwill be moved into here - Format: object with any fields
- e.g.
custom_data={some:'data'}
- e.g.
- Can be modified with the
set_custom_dataandcopy_custom_dataloot 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_dataloot function andcustom_datapredicate
- This is the same as is used in the
minecraft:damage
- The amount of durability removed from an item
- To set the attack damage for an item, see
minecraft:attribute_modifiers
- To set the attack damage for an item, see
- If removed, the item will not be damageable
- Format: non-negative integer
- e.g.
damage=12
- e.g.
- For damageable items (with the
max_damagecomponent), has an implicit default value of:0 - Can be modified with the
set_damageloot 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
- e.g.
- 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={}
- e.g.
- 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}orenchantments={sharpness:1}
- e.g.
- Can be modified with the
set_enchantments,enchant_randomly, andenchant_with_levelsloot 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 asminecraft:enchantments)- e.g.
stored_enchantments={'minecraft:protection':2}orstored_enchantments={sharpness:1}
- e.g.
- 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"}'
- e.g.
- Can be modified with the
set_nameloot 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!"}']
- e.g.
- If not set, has an implicit default value of:
[] - Can be modified with the
set_loreloot 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 tagnbt: block entity NBT to matchstate: 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)
- Same as
- To modify the tooltip, see
minecraft:tooltip_display
minecraft:dyed_color Changed in 1.21.5
- Represents a color applied to a dyeable item (in the
#minecraft:dyeableitem tag) - Format: RGB value
- e.g.
dyed_color=16711680(integer format) - e.g.
dyed_color=[0.5, 1.0, 0.2](array format)
- e.g.
- To modify the tooltip, see
minecraft:tooltip_display
minecraft:attribute_modifiers Changed in 1.21.5
- Holds attribute modifiers applied to any item
- Format: list of attribute modifiers
type: an attribute idslot: one of:any(default)hand: either in main or offhandarmor: any armour slotmainhandoffhandheadchestlegsfeetbody- Modifiers will only apply when the item is equipped in the specified slot
id: This is a unique identifier per attribute for the modifieramount: double, number of units to modify this attribute (controlled byoperation)operation: one of:add_value: Addsamountto the attributeadd_multiplied_base: Addsamount* base value to the attributeadd_multiplied_total: Addsamount* 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_attributesloot 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_contentsandset_contentsloot 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_projectilescomponent - Format: empty object
- e.g.
intangible_projectile={}
- e.g.
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_contentsandset_contentsloot functions
minecraft:map_color
- Represents the tint of the decorations on the Filled Map item
- Format: integer, RGB value
- e.g.
map_color=16711680
- e.g.
- 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:playerframered_markerblue_markertarget_xtarget_pointplayer_off_mapplayer_off_limitsmansionmonumentbanner_whitebanner_orangebanner_magentabanner_light_bluebanner_yellowbanner_limebanner_pinkbanner_graybanner_light_graybanner_cyanbanner_purplebanner_bluebanner_brownbanner_greenbanner_redbanner_blackred_xvillage_desertvillage_plainsvillage_savannavillage_snowyvillage_taigajungle_templeswamp_huttrial_chambers
x: double, world coordinatez: double, world coordinaterotation: 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
- e.g.
minecraft:custom_model_data Changed in 1.21.4
- Can be used to replace the models of items by selecting for the
minecraft:custom_model_dataproperty in the item model - Format: object with fields
floats: list of floats. Used by theminecraft:custom_model_dataitem model numeric property.flags: list of booleans. Used by theminecraft:custom_model_dataitem model boolean property.strings: list of strings. Used by theminecraft:custom_model_dataitem model discrete.colors: list of RGB color values. Used by theminecraft:custom_model_dataitem model tint source.- These lists of values are accessed by the various model property getters
- Can be modified with the
set_custom_model_dataloot function
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:consumablecomponent - 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
fooand the item isminecraft:lingering_potion, the name of item will be translation ofitem.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"
- e.g.
- On Potion or Tipped Arrow items, has an implicit default value of:
{} - Can be modified with the
set_potionloot 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_contentscomponent, the duration of the applied effects will be scaled by this factor - This also applies to
custom_effectsin theminecraft:potion_contentscomponent, 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 contentsfiltered: string, filtered page contents (optional)- If specified, players with chat filter enabled will see this page instead of
raw
- If specified, players with chat filter enabled will see this page instead of
- or: string, page plain text contents
- object with fields
- e.g.
writable_book_content={pages:['Hello world!']}orwritable_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_pagesloot 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_contentspages, except uses JSON chat component strings which can be formatted
- Same format as
title: filtered string (same format as pages)author: string, player namegeneration: integer [0; 3]- The number of times this book has been copied (
0= original)
- The number of times this book has been copied (
resolved: booleantrueif 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_pagesandset_book_coverloot 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:consumablecomponent - Format: list of effect objects with fields
id: effect idduration: 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_effectloot 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'}
- e.g.
- 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
idfield 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}
- Must contain an
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'
- e.g.
- Can be modified with the
set_instrumentloot 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']
- e.g.
- 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 zdimension: dimension id- If not present, the compass will spin
tracked: boolean (default:true)- If
true, when the Lodestone at the target position is removed, thetargetfield will be removed
- If
- 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 ofsmall_balllarge_ballstarcreeperburst
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
Flickertag
- Renamed from
- e.g.
firework_explosion={shape:'large_ball',colors:[16711680],has_trail:true}
- Can be modified with the
set_firework_explosionloot 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)- Same format as
minecraft:firework_explosioncomponent
- Same format as
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_fireworksloot function
minecraft:profile
- Controls the skin displayed on a Player Head
- Copied to Player Head block when placed
- If only a
nameis specified, it will be resolved into the corresponding player ID and skin data - Unlike
SkullOwnerwhich only supported resolution by name, if onlyidis 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_namecomponent 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'
- e.g.
- Can be modified with the
fill_player_headloot 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'
- e.g.
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 idcolor: 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_patternloot 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']
- e.g.
- 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 containeritem: 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_contentsandset_contentsloot 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 stringid: entity id- The remainder tags merged into the Bee when spawned
ticks_in_hive: integermin_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'
- e.g:
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 idseed: 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
- If not specified, or
- e.g.
container_loot={loot_table:'minecraft:chests/buried_treasure',seed:123}
- Can be modified with the
set_loot_tableloot 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
idtag 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
idfield 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'}]}
- Must contain an
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
Enchantmentstag 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
- If
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:consumablecomponent. - Format: object with fields
nutrition: Non-negative integer, the amount of nutrition applied when consumedsaturation: Float, the amount of saturation applied when consumedcan_always_eat: Boolean (defaulfalse), 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_damagecomponent- This means you need to add a negative
!max_damagecomponent to items that implicitly have one
- This means you need to add a negative
- Format: integer between 1 and 99
- e.g.
max_stack_size=4
- e.g.
- 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_sizecomponent greater than 1- This means you need to add a negative
!max_stack_sizecomponent to items that implicitly have one
- This means you need to add a negative
- Requires that the
damagecomponent is also present on the item - If not present, the item cannot be damaged
- Format: positive integer
- e.g.
max_damage=123
- e.g.
- 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 orderblocks: single block, list of blocks, or#-prefixed block tag to matchspeed(optional): float, overrides the mining speed if present and matchedcorrect_for_drops(optional): boolean, overrides whether this tool is considered ‘correct’ if present and matchedtruewill 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
- That means it will be overriden by components such as
minecraft:potion_contentsorminecraft:written_book_content
- That means it will be overriden by components such as
- When present, replaces default item name with contained chat component
- Differences from
custom_name:item_namecan’t be changed or removed in Anvilitem_nameis not styled with italics when displayed to playeritem_namedoes not show labels where applicable (for example: banner markers, names in item frames)
- Can be modified with the
set_nameloot 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
typestag - 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 enchanteduncommon: yellow name, or aqua when enchantedrare: aqua name, or light purple when enchantedepic: 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:consumablecomponent - Format: integer between 0 and 4
- e.g.
ominous_bottle_amplifier=3
- e.g.
- Can be modified with the
set_ominous_bottle_amplifierloot 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
- If
minecraft:food,minecraft:potion_contents,minecraft:ominous_bottle_amplifierorminecraft:suspicious_steware also present on this item, consuming this will apply the stats and effects of those components
- If
- Format: object with fields
consume_seconds: Non-negative float (default1.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 waitconsume_secondsbeforeon_consume_effects)eatdrinkblockbowspear(this is the trident animation)crossbowspyglasstoot_hornbrush
- Default value:
sound: Sound event (defaultentity.generic.eat)- The sound used during and on completion of the item’s consumption
has_consume_particles: Boolean (defaulttrue),- 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
typefield minecraft:apply_effectseffects: A list of status effect instances applied once consumedprobability: Float (default1.0)- The probability the above effects will be applied once consumed
minecraft:remove_effectseffects: 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_randomlydiameter: Positive float (default16.0),- The diameter that the consumer will be teleported within
minecraft:play_soundsound: Sound event, played once consumed
- There are currently 5 valid consume effects, identified by a
- 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}
- e.g.
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 forcooldown_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:idwill reference model/assets/<namespace>/items/<id>- e.g. model for item with
item_model=foo:baris 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 ofhead,chest,legs,feet,body,mainhand, oroffhandequip_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/pumpkinbluraddressestextures/misc/pumpkinblur.png
- For instance,
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-clickingdamage_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:pathwill use sprites with IDs:<namespace>:tooltip/<path>_backgroundand<namespace>:tooltip/<path>_frame
- e.g.
tooltip_style='minecraft:special_sword'
- A tooltip style of
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_effectsfield in theconsumablecomponent
- These effects are the same as those specified by the
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)- The amount to damage the weapon for each attack performed
- To set the attack damage for an item, instead see
minecraft:attribute_modifiers
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_secondson theminecraft:weaponcomponent) - If
0, this item can never be disabled by attacks
- Multiplier applied to the number of seconds that the item will be on cooldown for when attacked by a disabling attack (
-
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
thresholdis passed
- Constant amount of damage applied to the item, if
factor: float- Fraction of the dealt damage that should be applied to the item, if
thresholdis passed
- Fraction of the dealt damage that should be applied to the item, if
-
-
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'
- e.g.
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'
- e.g.
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_materialtag - As such, the trim material registry definition no longer specifies an item
- Format: trim material id
- e.g.
provides_trim_material='minecraft:iron'
- e.g.
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_tooltipfields,hide_additional_tooltipandhide_tooltipcomponents - 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”;