Item data components
Typed, named data attached to item stacks. Since 1.20.5 (pack_format 41) components replaced the old free-form item NBT tag: an item is now {id, count, components}. This page targets 1.21+ (ceiling 1.21.8, pack_format 81) and flags newer additions with version chips.
- Overview & the NBT migration
- Bracket syntax
- Full component catalogue
- custom_data β the workhorse
- custom_name, item_name, lore
- custom_model_data
- attribute_modifiers
- enchantments
- food & consumable
- container
- Matching in predicates & loot
- /item & item modifiers
- Complete examples
- Out-of-scope components
- Sources
Overview & the NBT migration
A data component is a typed, named piece of data attached to an item stack. Each component has a namespaced ID (minecraft:custom_name, minecraft:enchantments, β¦) and a schema fixed by the game. Components replaced the old free-form tag NBT compound, where any key could hold anything. They are strongly typed, individually addressable, and every item type ships a set of default components (a sword has default attribute_modifiers, max_damage, β¦). A stack only stores components that differ from the item's defaults β the "prototype" model.
The item object format from 1.20.5 onward:
Item object (JSON/SNBT)
{
id: "minecraft:stick", // required, namespaced; may NOT be minecraft:air
count: 1, // optional int, defaults to 1
components: { // map of non-default components only
"minecraft:custom_name": '{"text":"Wand","italic":false}',
"minecraft:enchantment_glint_override": true
}
}
- Before 1.20.5 (pack_format ≤26): an item was
{id, Count, tag:{β¦}}β a single free-form NBT compound. There were no components. - Since 1.20.5 (pack_format 41): the
tagNBT was removed entirely; the{id, count, components}format and the[β¦]/[!β¦]command syntax were introduced. The old{id, Count, tag}no longer parses. - When porting a pack forward, migrate
tag.display.Name→custom_name,tag.Enchantments→enchantments,tag.CustomModelData→custom_model_data, and any custom keys →custom_data. Do not mix the two syntaxes; they are gated bypack_format.
See Pack format for the full pack_format history. Recent milestones: 26 = 1.20.3β1.20.4 (pre-components), 41 = 1.20.5β1.20.6 (components introduced), 48 = 1.21β1.21.1, 57 = 1.21.2β1.21.3, 61 = 1.21.4, 71 = 1.21.5, 80 = 1.21.6, 81 = 1.21.7β1.21.8.
Bracket syntax
Components are written after the item ID in square brackets, =-assigned, comma-separated. This item-argument form is used everywhere an item is specified: /give, /item, predicates, recipe results, loot tables (via set_components), /clear, and /execute if items.
In a function or the chat console
/give @s minecraft:stick[minecraft:custom_name='{"text":"Wand","italic":false}',minecraft:enchantment_glint_override=true]
Default-namespace omission. The minecraft: namespace may be dropped for both the item and its components: custom_name is equivalent to minecraft:custom_name, so stick[custom_name='"Wand"'] is valid.
Always write the explicit minecraft: prefix in datapack files you intend to be unambiguous and portable. Omission is a convenience for typing commands by hand, not a style to commit to files.
Removing a default component with !component. To strip a component the item has by default, prefix it with ! and give no value. Setting and removing share the same bracket block.
Removing default components
/give @s minecraft:diamond_sword[!minecraft:attribute_modifiers] # sword with no attack bonus
/give @s minecraft:wooden_pickaxe[!minecraft:damage] # remove the damage component
/give @s minecraft:wooden_pickaxe[damage=23,repair_cost=2] # set damage + repair cost
Full component catalogue
The 96 components below exist in the 1.21.8 registry (data_component_type), grouped logically. Value types are drawn from the wiki Data component format pages. "{β¦}" means a compound/object, "[β¦]" a list. Components newer than 1.21 carry a version chip. Components present only in future (26.x) registries are excluded β see Out-of-scope components.
Naming / appearance
| Component | Value / schema | Notes |
|---|---|---|
custom_name | text component (string/JSON/list) | Player-set name; highest display priority; italic by default; editable/removable at an anvil. |
item_name | text component | Default/base name; not italic; cannot be erased at an anvil. 1.21.2+ |
item_model | string (model id) | Points to assets/<ns>/items/<id>.json item-model definition. 1.21.2+ (matured 1.21.4). |
lore | list of text components (≤256) | Extra tooltip lines under the name. |
rarity | enum common/uncommon/rare/epic | Sets the default name color. |
enchantment_glint_override | boolean | true forces glint, false hides it. |
custom_model_data | int (≤1.21.3) → object (1.21.4+) | Resource-pack model selector. Object {floats,flags,strings,colors}. See below. |
dyed_color | int RGB or [float,float,float] | Tint for leather armor etc. (R<<16)+(G<<8)+B. |
map_color | int RGB | Tint of the filled-map item icon. |
tooltip_display | {hide_tooltip:bool, hidden_components:[ids]} | Replaced hide_tooltip+hide_additional_tooltip and per-component show_in_tooltip. 1.21.5+ |
tooltip_style | string (id) | Custom tooltip frame/background style. 1.21.2+ |
Custom / datapack data
| Component | Value / schema | Notes |
|---|---|---|
custom_data | NBT compound (SNBT string or JSON object) | The datapack workhorse. Arbitrary data the game ignores; matchable in predicates. See below. |
Stacking / durability
| Component | Value / schema | Notes |
|---|---|---|
max_stack_size | int 1β99 | Maximum stack size. |
max_damage | int | Total durability. |
damage | int | Durability used (not remaining); default 0. |
unbreakable | {} (compound; empty ok) | Item takes no durability damage. Before 1.21.5 held a show_in_tooltip bool. |
repair_cost | int | Anvil XP penalty accumulator. |
repairable | {items: item-set} | Which items repair this at an anvil. 1.21.2+ |
enchantable | {value: int} | Enchantability at the table. 1.21.2+ |
Enchantments
| Component | Value / schema | Notes |
|---|---|---|
enchantments | {levels:{"<ench>":lvl}} (or bare map) | Active enchantments. |
stored_enchantments | same shape | Enchanted-book storage; no gameplay effect. |
Combat / tools / consumption
| Component | Value / schema | Notes |
|---|---|---|
attribute_modifiers | list of modifiers | Attribute bonuses. Gained a display sub-field in 1.21.5+. See below. |
tool | {rules:[β¦], default_mining_speed, damage_per_block, can_destroy_blocks_in_creative} | Mining behaviour. |
weapon | {item_damage_per_attack:int, disable_blocking_for_seconds:float} | Extracted from hardcoded weapon logic. 1.21.5+ |
food | {nutrition:int, saturation:float, can_always_eat:bool} | Nutrition payload only. Restructured 1.21.2+ (eating moved to consumable). See below. |
consumable | {consume_seconds, animation, sound, has_consume_particles, on_consume_effects:[β¦]} | Makes an item edible/drinkable. 1.21.2+ |
use_cooldown | {seconds:float, cooldown_group:id?} | Post-use cooldown. 1.21.2+ |
use_remainder | item stack | Item returned after use (e.g. bottle → glass bottle). 1.21.2+ |
damage_resistant | {types: "#damage_type_tag"} | Item survives listed damage in entity/equipped form. Replaced fire_resistant. 1.21.2+ |
blocks_attacks | {block_delay_seconds, disable_cooldown_scale, damage_reductions:[β¦], item_damage:{β¦}, β¦} | Shield-like blocking. 1.21.5+ |
death_protection | {death_effects:[consume-effectβ¦]} | Totem behaviour. 1.21.2+ |
break_sound | sound event (id / {sound_id,β¦}) | Sound when durability runs out. 1.21.5+ |
potion_duration_scale | float | Scales potion-effect durations from this item. 1.21.5+ |
Equipment / movement
| Component | Value / schema | Notes |
|---|---|---|
equippable | {slot, equip_sound?, asset_id?, allowed_entities?, dispensable?, swappable?, damage_on_hurt?, equip_on_interact?, camera_overlay?} | Makes any item wearable. 1.21.2+ |
glider | {} | Elytra-style gliding when equipped. 1.21.2+ |
Blocks / placement
| Component | Value / schema | Notes |
|---|---|---|
can_place_on | {predicates:[{blocks, nbt?, state?}], show_in_tooltip?} | Adventure-mode placement allow-list. |
can_break | same shape | Adventure-mode break allow-list. |
block_state | map {property:"value"} (strings) | Block-state props applied on placement. |
block_entity_data | NBT compound (needs id) | Block-entity NBT applied on placement. |
note_block_sound | string (sound id) | Note-block sound when this block (usually a head) sits atop one. |
Containers / projectiles
| Component | Value / schema | Notes |
|---|---|---|
container | list of {slot:int, item:{id,count,components}} | Stored contents (shulker boxes, chests, β¦); up to 256 slots. See below. |
container_loot | {loot_table:id, seed?:long} | Unresolved loot table; rolled when first opened. |
bundle_contents | list of item stacks | Bundle contents (no slot indices). |
charged_projectiles | list of item stacks | Loaded crossbow ammo. |
intangible_projectile | {} | Fired projectile can't be picked up (except in creative). |
Potions / effects
| Component | Value / schema | Notes |
|---|---|---|
potion_contents | {potion?:id, custom_color?:int, custom_name?:string, custom_effects?:[effectβ¦]} | Potions / tipped arrows / suspicious anything. |
suspicious_stew_effects | list of {id, duration} | Effects from suspicious stew. |
ominous_bottle_amplifier | int 0β4 | Bad Omen level granted by an ominous bottle. |
Books
| Component | Value / schema | Notes |
|---|---|---|
writable_book_content | {pages:[{raw:string, filtered?:string}]} | Book-and-quill contents. |
written_book_content | {title:{raw,filtered?}, author, generation, pages:[{raw,filtered?}], resolved?} | Signed book contents/metadata. |
Heads / decor / instruments
| Component | Value / schema | Notes |
|---|---|---|
profile | {name?, id?:int[4], properties?:[{name,value,signature?}]} (or bare name string) | Player-head skin/profile. |
instrument | string (id) or inline {sound_event, use_duration, range, description} | Goat-horn instrument. |
firework_explosion | {shape, colors:[int], fade_colors:[int], has_trail, has_twinkle} | Single explosion (firework star). |
fireworks | {flight_duration:byte, explosions:[explosionβ¦]} | Firework rocket. |
banner_patterns | list of {color, pattern} | Banner/shield patterns. |
base_color | dye-color string | Shield base color. |
pot_decorations | list of up to 4 sherd item ids | Decorated-pot faces. |
bees | list of {entity_data, min_ticks_in_hive, ticks_in_hive} | Beehive occupants. |
Trims / dyes / provides
| Component | Value / schema | Notes |
|---|---|---|
trim | {material:id, pattern:id, show_in_tooltip?} | Armor trim. |
provides_trim_material | id (or inline material) | Item usable as a smithing trim material. 1.21.5+ |
provides_banner_patterns | #banner_pattern tag | Item provides these loom patterns. 1.21.5+ |
dyed_color | int RGB or [float,float,float] | Leather-armor / dye tint (also listed under appearance). |
Maps / tracking / misc
| Component | Value / schema | Notes |
|---|---|---|
map_id | int | Filled-map id. |
map_decorations | map {key:{type,x,z,rotation}} | Extra map markers. |
map_post_processing | int (0 lock / 1 scale) | Transient map processing hint. |
lodestone_tracker | {target?:{pos:[int3],dimension}, tracked?:bool} | Compass lodestone lock. |
jukebox_playable | id (song) or {song} | Music-disc behaviour. Pre-1.21.5 wrapped {song, show_in_tooltip}. |
recipes | list of recipe ids | Knowledge-book unlocks. |
lock | item predicate (1.21.2+) / string (≤1.21.1) | "Key" required to open a locked container. Changed from a plain string to an item predicate in 1.21.2+. |
debug_stick_state | map {block_id: property} | Debug-stick selected properties. |
entity_data | NBT compound (needs id) | Entity NBT applied when an entity is created from the item (armor stands, minecarts, β¦). |
bucket_entity_data | NBT compound | Entity NBT for a mob released from a bucket (NoAI, Silent, NoGravity, Health, Age, β¦). |
creative_slot_lock | {} | Marks a creative hotbar slot locked (non-gameplay). |
Entity-variant components
Used on spawn eggs / buckets to fix a captured mob's variant. All added in 1.21.5+ (wolf/* present slightly earlier in the 1.21.5 cycle).
| Component | Fixes |
|---|---|
axolotl/variant | Axolotl color variant. |
cat/collar, cat/variant | Cat collar color / breed. |
chicken/variant | Chicken variant. |
cow/variant | Cow variant. |
fox/variant | Fox variant (red/snow). |
frog/variant | Frog variant. |
horse/variant | Horse coat variant. |
llama/variant | Llama variant. |
mooshroom/variant | Mooshroom (red/brown) variant. |
painting/variant | Painting motif. |
parrot/variant | Parrot color variant. |
pig/variant | Pig variant. |
rabbit/variant | Rabbit variant. |
salmon/size | Salmon size. |
sheep/color | Sheep wool color. |
shulker/color | Shulker color. |
tropical_fish/base_color, tropical_fish/pattern, tropical_fish/pattern_color | Tropical-fish appearance. |
villager/variant | Villager biome type. |
wolf/collar, wolf/sound_variant, wolf/variant | Wolf collar color / bark set / fur variant. |
custom_data β the workhorse
Arbitrary NBT the game never reads. This is how datapacks tag items so commands and predicates can recognize them. Values may be any NBT type including nested compounds. Set it as an SNBT string, or (in JSON contexts like loot tables) as a JSON object.
Schema: minecraft:custom_data: { <any keys>: <any NBT> }
Flagging items with custom_data
# Flag an item as a datapack "mana wand" with a numeric tier
/give @s minecraft:blaze_rod[minecraft:custom_data={mana_wand:1b,tier:3},minecraft:item_name='"Mana Wand"']
# Nested data
/give @s minecraft:paper[custom_data={quest:{id:"deliver_letter",stage:2b}}]
Loot-table / item-modifier result form (JSON, via set_components):
data/<ns>/loot_table/wand.json (fragment)
{ "function": "minecraft:set_components",
"components": { "minecraft:custom_data": { "mana_wand": 1, "tier": 3 } } }
- Since 1.20.5:
custom_dataexists and is unchanged. What changed is how you match it β the oldnbtitem predicate became thecustom_datasub-predicate. See Matching.
Use a short boolean flag ({my_pack_id:1b}) for detection instead of matching on custom_name (names are player-editable and localizable). Combine with max_stack_size=1 for one-time quest/currency tokens so they don't merge and can be counted individually. Version your data ({schema:2}) so future datapack updates can migrate old items.
custom_name, item_name, lore
custom_nameβ a text component; the player-facing display name with the highest priority; italic by default; can be renamed/removed at an anvil.item_name1.21.2+ β the base name; not italic; cannot be wiped at an anvil; ideal for datapack "canonical" naming (custom loot, trades).loreβ a list of up to 256 text-component lines shown under the name.
Named + lored sword
/give @s minecraft:iron_sword[minecraft:item_name='{"text":"Kingsblade","color":"gold","italic":false}',minecraft:lore=['{"text":"Forged in the deep","color":"gray","italic":true}','{"text":"+2 Strength","color":"dark_green"}']]
Loot-table form via set_name:
data/<ns>/loot_table/kingsblade.json (fragment)
{ "function": "minecraft:set_name", "entity": "this", "target": "item_name",
"name": { "text": "Kingsblade", "color": "gold" } }
Set "italic":false explicitly on custom_name to defeat the default italics. Use item_name (not custom_name) for datapack items so players renaming them at an anvil don't break name-based checks β though a custom_data flag is still the robust way to detect them.
custom_model_data
Signals a resource pack which custom model/texture to render. The format changed fundamentally in 1.21.4.
- ≤1.21.3: a single value (
custom_model_data=123456), matched by the pack'soverrides/predicateoncustom_model_data. - 1.21.4+ (object form): the item-model definition (
assets/<ns>/items/<id>.json) reads these lists by index.
1.21.4+ object schema
minecraft:custom_model_data: {
floats: [ ... ], // fed to the range_dispatch model type (index-based)
flags: [ ... ], // booleans for the condition model type
strings: [ ... ], // for the select model type
colors: [ ... ] // ints or [r,g,b] floats for a model's tints
}
Give examples across versions
# 1.21.3 and earlier
/give @s minecraft:carrot_on_a_stick[minecraft:custom_model_data=101]
# 1.21.4+
/give @s minecraft:paper[minecraft:custom_model_data={floats:[1.0],strings:["gui/coin"]}]
- 1.21.4: int/float value became the object
{floats,flags,strings,colors}, paired with the new item-model-definition system (theitem_modelcomponent arrived 1.21.2; JSON model selectorsrange_dispatch,condition,select,modelcame with 1.21.4).
This is the mechanism for resource-pack custom items (coins, GUIs, custom tools). Pre-1.21.4 packs used a single int; 1.21.4+ lets one base item host many models via string/flag selectors.
attribute_modifiers
A list; each entry describes one attribute change. See Techniques for attribute-driven mechanics.
Modifier entry schema
{
type: "minecraft:<attribute>", // e.g. attack_damage, max_health, movement_speed
id: "<namespaced id>", // unique per (attribute, slot)
amount: <double>,
operation: "add_value" | "add_multiplied_base" | "add_multiplied_total",
slot: "any"|"mainhand"|"offhand"|"hand"|"armor"|"head"|"chest"|"legs"|"feet"|"body"|"saddle",
display: { type: "default"|"hidden"|"override", value?: <text component> } // 1.21.5+
}
A sword with a bonus attack modifier
/give @s minecraft:diamond_sword[minecraft:attribute_modifiers=[{type:"minecraft:attack_damage",id:"my_pack:big_hit",amount:5,operation:"add_value",slot:"mainhand"}]]
- 1.20.5: introduced; each modifier had
type/id/amount/operation/slot, and the component held ashow_in_tooltipboolean. During the 1.20.5 cycle the old UUID+name pair collapsed to a single stringid. - 1.21.5: the
show_in_tooltipboolean was removed (tooltip control moved totooltip_display); a per-modifierdisplayobject was added; thesaddleslot arrived alongside rideable-mob changes.
Use the bracket form (diamond_sword[minecraft:attribute_modifiers=[β¦]]). The old curly-brace NBT (diamond_sword{β¦}) is the pre-1.20.5 form and no longer parses.
enchantments
A compound whose core is a levels map of enchantment id → level; a bare map is also accepted. stored_enchantments has the identical shape but is inert (used on enchanted books).
Schema shorthand
minecraft:enchantments: { levels: { "minecraft:sharpness": 5, "minecraft:unbreaking": 3 } }
# shorthand also works: minecraft:enchantments: { "minecraft:sharpness": 5 }
Give examples
/give @s minecraft:diamond_pickaxe[minecraft:enchantments={levels:{"minecraft:efficiency":5,"minecraft:fortune":3}}]
/give @s minecraft:book[minecraft:stored_enchantments={levels:{"minecraft:mending":1}}]
- Since 1.20.5: both exist. They carried a
show_in_tooltipboolean until 1.21.5, when it was removed in favor oftooltip_display.
enchantment_glint_override=true on any item (e.g. a plain stick) gives a "magical" look without real enchantments β a common cosmetic touch for custom weapons.
food & consumable
Before 1.21.2 the food component held both nutrition and eating behaviour. In 1.21.2 eating logic was extracted into consumable; food now holds only the nutrition payload, and an item is only edible if it also has consumable.
food schema: { nutrition: int, saturation: float, can_always_eat: bool=false } β the old eat_seconds, effects, and using_converts_to fields were removed and relocated to consumable / use_remainder.
consumable schema
{
consume_seconds: float = 1.6,
animation: "none"|"eat"|"drink"|"block"|"bow"|"spear"|"crossbow"|"spyglass"|"toot_horn"|"brush"|"bundle"|"trident" = "eat",
sound: <sound event> = "entity.generic.eat",
has_consume_particles: bool = true,
on_consume_effects: [ <consume-effect> ] // apply_effects, remove_effects, clear_all_effects, teleport_randomly, play_sound
}
Custom edible with a regeneration effect
/give @s minecraft:apple[minecraft:food={nutrition:6,saturation:7.2},minecraft:consumable={consume_seconds:1.6,animation:"eat",on_consume_effects:[{type:"minecraft:apply_effects",effects:[{id:"minecraft:regeneration",duration:100,amplifier:1}],probability:1.0}]}]
# Custom drink (glass bottle returned after)
/give @s minecraft:potion[minecraft:consumable={animation:"drink",sound:"entity.generic.drink"},minecraft:use_remainder={id:"minecraft:glass_bottle",count:1}]
- 1.20.5:
food={nutrition, saturation, can_always_eat, eat_seconds, effects:[{effect,probability}], using_converts_to}. - 1.21.2:
consumable,use_remainder,use_cooldown,death_protectionadded;foodslimmed to{nutrition, saturation, can_always_eat}; eat time/animation/sound/effects moved toconsumable; conversion moved touse_remainder.
To make any item edible, add both food (stats) and consumable (behaviour). on_consume_effects supports teleport_randomly (chorus-fruit style) and clear_all_effects (milk-bucket style).
container
container schema: a list of { slot: int, item: {id,count,components} }, up to 256 slots (the real limit is set by the block: chest 27, hopper 5, decorated pot 1). Nested items are full item objects and may themselves carry components, including a nested container.
container_loot schema: { loot_table: "<id>", seed?: <long> } β the container is filled from the loot table the first time it's opened (unresolved until then).
Pre-filled shulker box + loot-on-open chest
/give @s minecraft:shulker_box[minecraft:container=[{slot:0,item:{id:"minecraft:diamond",count:64}},{slot:1,item:{id:"minecraft:emerald",count:16}}]]
/give @s minecraft:chest[minecraft:container_loot={loot_table:"minecraft:chests/simple_dungeon"}]
- Since 1.20.5: both present; schema stable.
Matching in predicates & loot
The item sub-predicate (used by minecraft:match_tool, advancement inventory_changed/slots, /execute if items, loot entity_properties, β¦) matches components two ways β see Predicates and Advancements:
componentsβ exact match. The item's component must equal the value exactly.predicatesβ partial / sub-predicate match. Component-specific matchers that check some of a component's data (includingminecraft:custom_data).
Both match styles in one item sub-predicate
{
"items": "#minecraft:swords",
"components": { // EXACT
"minecraft:enchantment_glint_override": true
},
"predicates": { // PARTIAL
"minecraft:custom_data": "{mana_wand:1b}",
"minecraft:enchantments": { "minecraft:sharpness": { "min": 3 } }
}
}
Key renames introduced with components (1.20.5): the old nbt predicate became the custom_data sub-predicate (matches only minecraft:custom_data); the flat enchantments/stored_enchantments/potions fields moved to the minecraft:enchantments / minecraft:stored_enchantments / minecraft:potion_contents sub-predicates.
Use predicates + custom_data to detect datapack items β it is robust and partial. Reserve components (exact) for the rare case where you truly need an exact value, since an exact match must include every field of the component.
data/<ns>/advancement/got_wand.json β trigger on picking up a datapack item
{ "criteria": { "got_wand": {
"trigger": "minecraft:inventory_changed",
"conditions": { "items": [ {
"predicates": { "minecraft:custom_data": "{mana_wand:1b}" }
} ] } } },
"requirements": [["got_wand"]] }
/item & item modifiers
Items are not directly /data-editable β an item stack is not a block/entity/storage target. The tool for editing item components in the world is /item plus item-modifier functions (the same functions loot tables use). See Item modifiers and Loot tables.
/item replace <target> <slot> with <item>[components] [count]β overwrite a slot with a fully specified item./item modify <target> <slot> <modifier>β apply an item modifier (inline{β¦}or a referenceditem_modifier/*.json) to whatever is in the slot./item replace β¦ from β¦and/item modify β¦ from β¦copy between slots.
| Function | Effect |
|---|---|
minecraft:set_components | Set/overwrite listed components on the item. |
minecraft:set_custom_data / set_custom_model_data / set_name / set_lore | Targeted setters. |
minecraft:copy_components | Copy components from a block entity (source block_entity) onto the item β e.g. copy a spawner/container's data. |
minecraft:copy_custom_data | Copy NBT from an entity/block/storage source into custom_data. |
Stamp custom_data onto the held item
/item modify entity @s weapon.mainhand {"function":"minecraft:set_components","components":{"minecraft:custom_data":{blessed:1b}}}
Item-modifier file form (data/<ns>/item_modifier/blessed.json) referenced as:
/item modify entity @s weapon.mainhand my_pack:blessed
- Since 1.20.5: the component-oriented functions (
set_components,copy_components,set_custom_data) operate on the component model rather thantagNBT.copy_components(block-entity → item) is the modern replacement for the oldBlockEntityTagcopying.
Complete examples
A full custom item β named, flagged, buffed, glinting, unstackable
/give @s minecraft:blaze_rod[minecraft:item_name='{"text":"Mana Wand","color":"aqua","italic":false}',minecraft:lore=['{"text":"Tier III","color":"gray","italic":false}'],minecraft:custom_data={mana_wand:1b,tier:3},minecraft:enchantment_glint_override=true,minecraft:max_stack_size=1,minecraft:attribute_modifiers=[{type:"minecraft:attack_damage",id:"my_pack:wand_hit",amount:2,operation:"add_value",slot:"mainhand"}]]
data/<ns>/loot_table/mana_wand.json β component form inside a loot result
{
"pools": [ {
"rolls": 1,
"entries": [ {
"type": "minecraft:item",
"name": "minecraft:blaze_rod",
"functions": [ {
"function": "minecraft:set_components",
"components": {
"minecraft:item_name": { "text": "Mana Wand", "color": "aqua" },
"minecraft:custom_data": { "mana_wand": 1, "tier": 3 },
"minecraft:enchantment_glint_override": true,
"minecraft:max_stack_size": 1
}
} ]
} ]
} ]
}
Same marker in a shaped-recipe result β see the Recipes page
{
"type": "minecraft:crafting_shaped",
"pattern": [ " b ", " s ", " s " ],
"key": { "b": { "item": "minecraft:blaze_powder" }, "s": { "item": "minecraft:stick" } },
"result": {
"id": "minecraft:blaze_rod",
"count": 1,
"components": { "minecraft:custom_data": { "mana_wand": 1, "tier": 1 } }
}
}
A custom_data flag driving datapack logic in a function
# data/my_pack/function/wand/tick.mcfunction
execute as @a[nbt={SelectedItem:{components:{"minecraft:custom_data":{mana_wand:1b}}}}] at @s \
run function my_pack:wand/cast
See Recipes for full recipe-result syntax and Functions for the command layer.
Out-of-scope components
These are not in the 1.21.8 registry and must not be used in a 1.21.x datapack.
Future (26.x-only), unverified for 1.21.8: additional_trade_cost, attack_range, block_transformer, compostable, damage_type, dye, kinetic_weapon, minimum_attack_charge, piercing_weapon, provides_pottery_pattern, swing_animation, use_effects, sulfur_cube_content, and the extra *_sound_variant mob components. They appear in the latest registry snapshots but are beyond this page's 1.21.8 ceiling.
- Removed before 1.21.8:
fire_resistant(→damage_resistant, 1.21.2);hide_tooltip+hide_additional_tooltip(→ merged intotooltip_display, 1.21.5).
April-Fools snapshot components (snek, potato_bane, secret_message, world_effect_unlock, β¦) are joke content and never part of a stable release.
Sources
- Data component format (master page) β minecraft.wiki
- custom_data β minecraft.wiki
- custom_model_data β minecraft.wiki
- consumable β minecraft.wiki
- food β minecraft.wiki
- attribute_modifiers β minecraft.wiki
- container β minecraft.wiki
- tooltip_display β minecraft.wiki
- written_book_content β minecraft.wiki
- Predicate (item sub-predicate: components vs predicates) β minecraft.wiki
- Java Edition 1.20.5 (component introduction, bracket / ! syntax) β minecraft.wiki
- misode/mcmeta β version-pinned data_component_type registries
- NeoForge 1.21.4 migration primer (custom_model_data object change)
- misode β 1.21.2 changes (food / consumable split)
- misode data-pack generator (interactive item/component builder)