Components¶
As of Minecraft 1.20.6, items now use what is called Components, or DataComponents, to specify specific features. This covers anything from consumable items, tool-properties and death protection.
Due to the nature of these they are very version-specific, so there are some differences and new additions between Minecraft version changes.
Each component below has a hover-click to show an example of how to use it, with additional info.
Max Stack Size1 - Sets the maximum slot-size for the NexoItem
Enchantment Glint Override2 - Sets an override-state for the enchantment glint
Fire Resistant3 - Sets whether this NexoItem is immune to fire and lava
Max Damage4 - Sets the maximum amount of damage the NexoItem can take
Hide Tooltip5 - Hides all tooltips from the given NexoItem on hover
Food6 - Makes this item consumable with several different properties
Tool7 - Makes your item into a tool with configurable behaviour for blocks its breaking
Custom Data8 - Defines custom properties to add to the item
Jukebox Playable9 - Lets this item be inserted into a Jukebox and play a given song
Consumable10 - Makes an item consumable, with bunch of sub-properties
Equippable11 - Makes an item equippable, like armor
Damage Resistant12 - Specify a damage-type this item is invulnerable to
Enchantable13 - Set the maximum enchantment-cost for this item
Glider14 - Allows the player to glide, like with elytras, when equipped
Item Model 15- Defines the base model-properties of this item
Tooltip Style16 - Used to make custom tooltip-styles for your item
Use Cooldown17 - Applies a cooldown to all matching items when used
Use Remainder18 - Replaces the item with a remainder item if its stack count has decreased after use
Repairable19 - What item(s) should be allowed in anvils to repair durability
Death Protection20 - Protects the player from when equipped on death. Optionally applies effects too
Player Profile21 - Specify profile-properties to show player-skins on item
Unset Components22 - This lets you specify Components Nexo should remove from the item
Custom Model Data23 - Used for all the new formatting for 1.21.4 CMD component
Tooltip Display24 - Sets the Components to hide tooltips from. This should be used instead of ItemFlags
Break Sound25 - Set the sound to play when the item loses all its durability
Weapon26 - Makes the item act like a weapon
Blocks Attacks27 - Makes the item act as a shield & can block attacks
CanPlaceOn/CanBreak28 - Defines what this item can break or be placed on in Adventure Mode
Painting Variant29 - Used with the new ๐ผ๏ธ Custom Paintings feature to specify which painting to place
Kinetic Weapon30 - Enables charge-type attack when using item
Piercing Weapon31 - Actions done when weapon pierces target
Attack Range32 - The range and hitbox margin of a weapon
Use Effects34 - Vibration & player movement penalties when continuously using item
Damage Type35 - The type of damage the item deals
Minimum Attack Charge36 - Minimum attack-indicator value required to attack with item
New properties for 26.3+:
Compostable39 - Lets the item be put into a composter and how many layers it fills
Cooking Fuel40 - Lets the item be used as fuel in furnaces, and how fast it smelts
Brewing Fuel41 - Lets the item be used as fuel in brewing stands, and how fast it brews
Attack Animation42 - The animation to play when attacking with the item
Interact Animation43 - The animation to play when using the item
Warning
Minecraft 26.3 removed the swing_animation-component, splitting it into attack_animation and interact_animation.
A swing_animation-entry is ignored on 26.3+, so move it over to one or both of the new components
Info
The number-properties of the fuel- and compostable-components, like burn_time or speed_multiplier, also accept the key of an entry in the vanilla context_int_provider or context_float_provider registries.
This lets the value vary in-game instead of being a fixed number
Max Stack Size1 - Sets the maximum slot-size for the NexoItem
Enchantment Glint Override2 - Sets an override-state for the enchantment glint
Fire Resistant3 - Sets whether this NexoItem is immune to fire and lava
Max Damage4 - Sets the maximum amount of damage the NexoItem can take
Hide Tooltip5 - Hides all tooltips from the given NexoItem on hover
Food6 - Makes this item consumable with several different properties
Tool7 - Makes your item into a tool with configurable behaviour for blocks its breaking
Custom Data8 - Defines custom properties to add to the item
Jukebox Playable9 - Lets this item be inserted into a Jukebox and play a given song
Consumable10 - Makes an item consumable, with bunch of sub-properties
Equippable11 - Makes an item equippable, like armor
Damage Resistant12 - Specify a damage-type this item is invulnerable to
Enchantable13 - Set the maximum enchantment-cost for this item
Glider14 - Allows the player to glide, like with elytras, when equipped
Item Model 15- Defines the base model-properties of this item
Tooltip Style16 - Used to make custom tooltip-styles for your item
Use Cooldown17 - Applies a cooldown to all matching items when used
Use Remainder18 - Replaces the item with a remainder item if its stack count has decreased after use
Repairable19 - What item(s) should be allowed in anvils to repair durability
Death Protection20 - Protects the player from when equipped on death. Optionally applies effects too
Player Profile21 - Specify profile-properties to show player-skins on item
Unset Components22 - This lets you specify Components Nexo should remove from the item
Custom Model Data23 - Used for all the new formatting for 1.21.4 CMD component
Tooltip Display24 - Sets the Components to hide tooltips from. This should be used instead of ItemFlags
Break Sound25 - Set the sound to play when the item loses all its durability
Weapon26 - Makes the item act like a weapon
Blocks Attacks27 - Makes the item act as a shield & can block attacks
CanPlaceOn/CanBreak28 - Defines what this item can break or be placed on in Adventure Mode
Painting Variant29 - Used with the new ๐ผ๏ธ Custom Paintings feature to specify which painting to place
New properties for 1.21.11+:
Kinetic Weapon30 - Enables charge-type attack when using item
Piercing Weapon31 - Actions done when weapon pierces target
Attack Range32 - The range and hitbox margin of a weapon
Swing Animation33 - The Animation to play when swinging item
Use Effects34 - Vibration & player movement penalties when continuously using item
Damage Type35 - The type of damage the item deals
Minimum Attack Charge36 - Minimum attack-indicator value required to attack with item
Max Stack Size1 - Sets the maximum slot-size for the NexoItem
Enchantment Glint Override2 - Sets an override-state for the enchantment glint
Fire Resistant3 - Sets whether this NexoItem is immune to fire and lava
Max Damage4 - Sets the maximum amount of damage the NexoItem can take
Hide Tooltip5 - Hides all tooltips from the given NexoItem on hover
Food6 - Makes this item consumable with several different properties
Tool7 - Makes your item into a tool with configurable behaviour for blocks its breaking
Custom Data8 - Defines custom properties to add to the item
Jukebox Playable9 - Lets this item be inserted into a Jukebox and play a given song
Consumable10 - Makes an item consumable, with bunch of sub-properties
Equippable11 - Makes an item equippable, like armor
Damage Resistant12 - Specify a damage-type this item is invulnerable to
Enchantable13 - Set the maximum enchantment-cost for this item
Glider14 - Allows the player to glide, like with elytras, when equipped
Item Model 15- Defines the base model-properties of this item
Tooltip Style16 - Used to make custom tooltip-styles for your item
Use Cooldown17 - Applies a cooldown to all matching items when used
Use Remainder18 - Replaces the item with a remainder item if its stack count has decreased after use
Repairable19 - What item(s) should be allowed in anvils to repair durability
Death Protection20 - Protects the player from when equipped on death. Optionally applies effects too
Player Profile21 - Specify profile-properties to show player-skins on item
Unset Components22 - This lets you specify Components Nexo should remove from the item
Custom Model Data23 - Used for all the new formatting for 1.21.4 CMD component
Tooltip Display24 - Sets the Components to hide tooltips from. This should be used instead of ItemFlags
Break Sound25 - Set the sound to play when the item loses all its durability
Weapon26 - Makes the item act like a weapon
Blocks Attacks27 - Makes the item act as a shield & can block attacks
CanPlaceOn/CanBreak28 - Defines what this item can break or be placed on in Adventure Mode
New properties for 1.21.8+:
Painting Variant29 - Used with the new ๐ผ๏ธ Custom Paintings feature to specify which painting to place
Max Stack Size1 - Sets the maximum slot-size for the NexoItem
Enchantment Glint Override2 - Sets an override-state for the enchantment glint
Fire Resistant3 - Sets whether this NexoItem is immune to fire and lava
Max Damage4 - Sets the maximum amount of damage the NexoItem can take
Hide Tooltip5 - Hides all tooltips from the given NexoItem on hover
Food6 - Makes this item consumable with several different properties
Tool7 - Makes your item into a tool with configurable behaviour for blocks its breaking
Custom Data8 - Defines custom properties to add to the item
Jukebox Playable9 - Lets this item be inserted into a Jukebox and play a given song
Consumable10 - Makes an item consumable, with bunch of sub-properties
Equippable11 - Makes an item equippable, like armor
Damage Resistant12 - Specify a damage-type this item is invulnerable to
Enchantable13 - Set the maximum enchantment-cost for this item
Glider14 - Allows the player to glide, like with elytras, when equipped
Item Model 15- Defines the base model-properties of this item
Tooltip Style16 - Used to make custom tooltip-styles for your item
Use Cooldown17 - Applies a cooldown to all matching items when used
Use Remainder18 - Replaces the item with a remainder item if its stack count has decreased after use
Repairable19 - What item(s) should be allowed in anvils to repair durability
Death Protection20 - Protects the player from when equipped on death. Optionally applies effects too
Player Profile21 - Specify profile-properties to show player-skins on item
Unset Components22 - This lets you specify Components Nexo should remove from the item
Custom Model Data23 - Used for all the new formatting for 1.21.4 CMD component
New properties for 1.21.5+:
Tooltip Display24 - Sets the Components to hide tooltips from. This should be used instead of ItemFlags
Break Sound25 - Set the sound to play when the item loses all its durability
Weapon26 - Makes the item act like a weapon
Blocks Attacks27 - Makes the item act as a shield & can block attacks
CanPlaceOn/CanBreak28 - Defines what this item can break or be placed on in Adventure Mode
Max Stack Size1 - Sets the maximum slot-size for the NexoItem
Enchantment Glint Override2 - Sets an override-state for the enchantment glint
Fire Resistant3 - Sets whether this NexoItem is immune to fire and lava
Max Damage4 - Sets the maximum amount of damage the NexoItem can take
Hide Tooltip5 - Hides all tooltips from the given NexoItem on hover
Food6 - Makes this item consumable with several different properties
Tool7 - Makes your item into a tool with configurable behaviour for blocks its breaking
Custom Data8 - Defines custom properties to add to the item
Jukebox Playable37 - Lets this item be inserted into a Jukebox and play a given song
Consumable10 - Makes an item consumable, with bunch of sub-properties
Equippable11 - Makes an item equippable, like armor
Damage Resistant12 - Specify a damage-type this item is invulnerable to
Enchantable13 - Set the maximum enchantment-cost for this item
Glider14 - Allows the player to glide, like with elytras, when equipped
Item Model 15- Defines the base model-properties of this item
Tooltip Style16 - Used to make custom tooltip-styles for your item
Use Cooldown17 - Applies a cooldown to all matching items when used
Use Remainder18 - Replaces the item with a remainder item if its stack count has decreased after use
Repairable19 - What item(s) should be allowed in anvils to repair durability
Death Protection20 - Protects the player from when equipped on death. Optionally applies effects too
Player Profile21 - Specify profile-properties to show player-skins on item
Unset Components22 - This lets you specify Components Nexo should remove from the item
New properties for 1.21.4+:
Custom Model Data23 - Used for all the new formatting for 1.21.4 CMD component
Max Stack Size1 - Sets the maximum slot-size for the NexoItem
Enchantment Glint Override2 - Sets an override-state for the enchantment glint
Fire Resistant3 - Sets whether this NexoItem is immune to fire and lava
Max Damage4 - Sets the maximum amount of damage the NexoItem can take
Hide Tooltip5 - Hides all tooltips from the given NexoItem on hover
Food6 - Makes this item consumable with several different properties
Tool7 - Makes your item into a tool with configurable behaviour for blocks its breaking
Custom Data8 - Defines custom properties to add to the item
Jukebox Playable37 - Lets this item be inserted into a Jukebox and play a given song
New properties for 1.21.3+:
Consumable10 - Makes an item consumable, with bunch of sub-properties
Equippable11 - Makes an item equippable, like armor
Damage Resistant12 - Specify a damage-type this item is invulnerable to
Enchantable13 - Set the maximum enchantment-cost for this item
Glider14 - Allows the player to glide, like with elytras, when equipped
Item Model 15- Defines the base model-properties of this item
Tooltip Style16 - Used to make custom tooltip-styles for your item
Use Cooldown17 - Applies a cooldown to all matching items when used
Use Remainder18 - Replaces the item with a remainder item if its stack count has decreased after use
Repairable19 - What item(s) should be allowed in anvils to repair durability
Death Protection20 - Protects the player from when equipped on death. Optionally applies effects too
Player Profile21 - Specify profile-properties to show player-skins on item
Unset Components22 - This lets you specify Components Nexo should remove from the item
Max Stack Size1 - Sets the maximum slot-size for the NexoItem
Enchantment Glint Override2 - Sets an override-state for the enchantment glint
Fire Resistant3 - Sets whether this NexoItem is immune to fire and lava
Max Damage4 - Sets the maximum amount of damage the NexoItem can take
Hide Tooltip5 - Hides all tooltips from the given NexoItem on hover
Food38 - Makes this item consumable with several different properties
Tool7 - Makes your item into a tool with configurable behaviour for blocks its breaking
New properties for 1.21.1+:
Custom Data8 - Defines custom properties to add to the item
Jukebox Playable37 - Lets this item be inserted into a Jukebox and play a given song
- ↩↩↩↩↩↩↩
- ↩↩↩↩↩↩↩
- ↩↩↩↩↩↩↩
-
can_always_eat - Defaults to false if unspecified
eat_seconds - Defaults to 1.6 if unspecified ↩↩↩↩↩↩ -
my_item: Components: tool: damage_per_block: default_mining_speed: rules: - speed: 1.0 correct_for_drops: true material: DIAMOND_BLOCK #materials: # - DIAMOND_BLOCK # - NETHERITE_BLOCK tag: minecraft:mineable/axe #tags: # - minecraft:mineable/axe # - minecraft:mineable/shoveldamage_per_block:
The amount of damage to apply to the tool per block broken. Defaults to 1
default_mining_speed:The default speed of this tool, excluding modifiers in rules. Defaults to 1.0
Rules:
Rules are behaviour for specific blocks.
You can set the speed, if the tool is correct and the block should drop its drop, etc
Tags:
List of all tags can be found here ↩↩↩↩↩↩↩ -
my_item: Components: custom_data: nexo:string: "Some string" nexo:integer: 2 nexi:integer_list: [1, 2, 3] nexo:string_list: - "something" - "something else" nexo:compound: nexo:c_string: "String" nexo:c_integer: 3 namespace:boolean: trueThis is data that is added into the "root" of the CustomData on the Item.
It is one step outside what PersistentData is ↩↩↩↩↩↩↩ -
This component lets you mark an item as a "Music Disc". It can then be inserted into a jukebox to play a given sound.
The sound is the key defined in either your sounds.json in your ResourcePack, or in Nexo's sounds.yml ↩↩↩↩ -
↩↩↩↩↩↩
my_item: Components: consumable: sound: minecraft:entity.generic.eat # Optional, default is entity.generic.eat consume_particles: true # Optional, default is true consume_duration: 1.6s # Optional, default is 1.6s animation: EAT # Optional, default is EAT effects: APPLY_EFFECTS: mining_fatigue: duration: 10t amplifier: 1 ambient: false show_icon: true show_particles: true probability: 1.0 REMOVE_EFFECTS: - speed CLEAR_ALL_EFFECTS: {} TELEPORT_RANDOMLY: diameter: 16.0 PLAY_SOUND: sound: minecraft:ambient.basalt_deltas.additions1 -
my_item: Components: equippable: slot: HEAD #asset_id: minecraft:example #camera_overlay: minecraft:example #equip_sound: item.armor.equip_chain #allowed_entity_types: # - PLAYER # - SKELETON #dispensable: true #swappable: true #damage_on_hurt: trueMinecraft Wiki
Asset ID:The asset to show for the equipped texture.
If using a 3D Model for helmet, do not specify this fieldCamera Overlay:
The resource-overlay to show on screen whilst equipped.
This field is optionalEquip Sound:
The sound to play when equipped.
Defaults toitem.armor.equip_genericAllowed Entity Types:
A list of all types can be found here
If unspecified, defaults to all entities ↩↩↩↩↩↩ -
This specifies the DamageType the item is invulnerable to.
If you want a custom DamageType which the vanilla ones do not cover, you will need to add it via a custom Datapack
A list of all DamageTypes can be found here ↩↩↩↩↩↩ -
This specifies the maximum Enchantment Cost for this item.
Setting this to 0 will prevent the item from being enchantable ↩↩↩↩↩↩ -
This defines the base model of an item.
By default it will useminecraft:type
For PAPER this would beminecraft:paper
It is heavily recommended to use a custom ItemModel instead of CustomModelData when possible
With an ItemModel you do not need CustomModelData as you alter the base-model of your item
Nexo will make this for you if you manually set this property in your item, and do not have CustomModelData specified, or you have enabledPack.generation.prefer_item_modelsinsettings.yml↩↩↩↩↩↩ -
A Tooltip Style refers to a set of textures in your ResourcePack.
It is made up of a background and frame texture, with an optional mcmeta file for each
It can also be customized & animated using MCMeta
The config property refers to this path in your ResourcePack:
assets/NAMESPACE/textures/gui/sprites/tooltip/KEY_frame
assets/NAMESPACE/textures/gui/sprites/tooltip/KEY_background↩↩↩↩↩↩ -
This component triggers the cooldown feature for this Item, similar to using an Ender Pearl in vanilla.
Duration:
The time the cooldown should last. Defaults to 1.0s
Group (Optional):
This can be used to apply the cooldown on all instances of an item & even other items with the same group ↩↩↩↩↩↩ -
↩↩↩↩↩↩
my_item: Components: use_remainder: #minecraft_type: DIAMOND #crucible_item: crucibleid #mmoitems_id: id #mmoitems_type: type nexo_item: itemid -
This defines the items that can be used to repair this NexoItem.
It only supports vanilla Materials, not Custom Items.
It supports both tags and individual materials, like shown above.
Can be a single entry or a list of entries ↩↩↩↩↩↩ -
↩↩↩↩↩↩
my_item: Components: death_protection: death_effects: #Optional, can be empty/set to [] APPLY_EFFECTS: mining_fatigue: duration: 10t amplifier: 1 ambient: false show_icon: true show_particles: true probability: 1.0 REMOVE_EFFECTS: - speed CLEAR_ALL_EFFECTS: {} TELEPORT_RANDOMLY: diameter: 16.0 PLAY_SOUND: sound: minecraft:ambient.basalt_deltas.additions -
myitem: material: PLAYER_HEAD Components: profile: name: boy0000 uuid: 1234 properties: name: name value: value signature: signatureThe component can be applied to any item, but only has a visible effect for those with PLAYER_HEAD material.
In the profile component itself, you have to specify either name, uuid or properties, not all.
Properties is mostly for referencing skins from databases etc which might not be entirely linked to a player anymore.
In properties, name and value are required, but signature is optional ↩↩↩↩↩↩ - ↩↩↩↩↩↩
-
my_item: Components: tooltip_display: - minecraft:dyed_color - minecraft:enchantments - minecraft:attribute_modifiersThis component is used to replace the old
show_in_tooltip-property for individual components.
A list of components can be found here
Ifhide_tooltip-component is set to true, this is ignored ↩↩↩↩ - ↩↩↩↩
- ↩↩↩↩
-
my_item: Components: blocks_attacks: block_delay: 0.0s disable_cooldown_scale: 1.0 block_sound: namespace:key disable_sound: namespace:key bypassed_by: namespace:key item_damage: base: 1.0 factor:1.0 threshold: 0.0 damage_reductions: - base: 1.0 factor: 1.0 horizontal_blocking: 90.0 types: namespace:key #types: # - namespace:keyDamage Reductions:
types can be specified as a single element or a list, and takes a NamespacedKey for a DamageType or Tag ↩↩↩↩
-
This supports all block-ids or block-tags.
Can either specify a single element or a list of elements ↩↩↩↩ - ↩↩↩
-
↩↩
my_item: Components: kinetic_weapon: contact_cooldown: 10t delay: 0t damage_multiplier: 1.0 sound: namespace:key hit_sound: namespace:key dismount_conditions: max_duration: 0t min_speed: 0f min_relative_speed: 0f knockback_conditions: max_duration: 0t min_speed: 0f min_relative_speed: 0f damage_conditions: max_duration: 0t min_speed: 0f min_relative_speed: 0f -
↩↩
my_item: Components: piercing_weapon: sound: namespace:key hit_sound: namespace:key dismounts: false deals_knockback: true -
↩↩
my_item: Components: attack_range: reach: 0..64 #min_reach: 0 #max_read: 64 hitbox_margin: 0.3 mob_factor: 1 - ↩↩
- ↩↩
- ↩↩
-
This component lets you mark an item as a "Music Disc". It can then be inserted into a jukebox to play a given sound.
The sound is the key defined in either your sounds.json in your ResourcePack, or in Nexo's sounds.yml ↩↩↩ -
my_item: Components: food: nutrition: 2 saturation: 2 can_always_eat: false eat_seconds: 1.6 replacement: #minecraft_type: DIAMOND #crucible_item: crucibleid #eco_item: ecoid #mmoitems_id: id #mmoitems_type: type nexo_item: itemid effects: mining_fatigue: duration: 10t amplifier: 1 ambient: false show_icon: true show_particles: true probability: 0.5can_always_eat - Defaults to false if unspecified
eat_seconds - Defaults to 1.6 if unspecified ↩ -
layers - How many of the composters layers the item fills when used, the composter needing 7 to produce bonemeal
An omitted property keeps the value the base-material already has, or defaults to 1 layer for materials that are not compostable in vanilla ↩
-
burn_time - How long the item burns for in a furnace. A plain number is read as seconds, add a suffix like
200tfor other units
speed_multiplier - How fast the furnace cooks while burning this fuel, 1.0 being the normal speedAn omitted property keeps the value the base-material already has, or defaults to a burn-time of 0 and a multiplier of 1.0 for materials that are no fuel in vanilla ↩
-
uses - How many brewing-operations the item fuels, blaze powder having 20
speed_multiplier - How fast the brewing stand brews while running on this fuel, 1.0 being the normal speedAn omitted property keeps the value the base-material already has, or defaults to 1 use and a multiplier of 1.0 for materials that are no brewing-fuel in vanilla ↩