Components
Last updated
Last updated
If the command is too long I recommend you to use command blocks, for better guidance use
These allow you to modify different properties of the items, and also some are exclusive for entities.
armor
0
0~30
Armor defense points.
armor_toughness
0
0~20
attack_damage
2
0~2048
Damage dealt by attacks, in half-hearts.
attack_knockback
0
0~5
Knockback applied to attacks. Applies only to mobs with physical attacks.
generic.attack_reach
2.5
0~6
Determines the reach at which players can attack entities. Does not affect interaction range.
attack_speed
4
0~1024
Determines recharging rate of attack strength. Value is the number of full-strength attacks per second.
flying_speed
0.4
0~1024
Flight speed modifier in some unknown metric.
knockback_resistance
0
0~1
The scale of horizontal knockback resisted from attacks and projectiles. Vertical knockback is not affected. Does not affect explosions. The resistance functions as a percentage from 0.0 (0% resistance) to 1.0 (100% resistance) (e.g. 0.4 is 40% resistance, meaning the attributed mob takes 60% of usual knockback). Iron golems and wardens suffer zero knockback from attacks or projectiles.
block_interaction_range
4.5
0~64
The block interaction range for players in blocks.
block_break_speed
1
0~1024
The speed the player can break blocks as a multiplier.
mining_efficiency
0
0~1024
A factor to speed up the mining of blocks when using the right tool.
sneaking_speed
0.3
0~1
The movement speed factor when sneaking or crawling. A factor of 1 means sneaking or crawling is as fast as walking, a factor of 0 means unable to move while sneaking or crawling.
submerged_mining_speed
0.2
0~20
The mining speed factor when underwater. A factor of 1 means mining as fast as on land, a factor of 0 means unable to mine while submerged. This represents only the submersion factor itself; other factors (such as not touching the ground) also apply
sweeping_damage_ratio
0
0~1
Determines how much of the base attack damage gets transferred to secondary targets in a sweep attack. This is in addition to the base attack of the sweep damage itself. A value of 1 means that all of the base attack damage is transferred (sweep damage is attack_damage + 1)
oxygen_bonus
0
0~1024
Determines the chance that an entity's Air
data tag decreases in any given game tick, while the entity is underwater. The chance is given by 1 / (oxygen_bonus +1)
.
movement_efficiency
0
0~1024
A factor to improve walking on terrain that slows down movement. A value of 1 removes the slowing down.
explosion_knockback_resistance
0
0~1
Defines what percentage of knockback an entity resists. A value of 1 eliminates the knockback.
burning_time
1
0~1024
Amount of time how long an entity remains on fire after being ignited as a multiplier. A value of 0 eliminates the burn time. Has no impact on the burning time increase when staying in fire.
Component Values
type
The name of the attribute this modifier is to act upon
slot
Slot or slot type the item must be in for the modifier to take effect
Can be any
, hand
, armor
, mainhand
, offhand
, head
, chest
, legs
, feet
or body
. Defaults to any
id
The unique resource location to identify this modifier.
amount
Amount of change from the modifier.
operation
Operations Value
add_value
(+- amount
)
Adds all of the modifiers' amounts to the base attribute.
Total
= Base
+ Amount1
+ Amount2
+ …
+ Amount
n
For example, applying two add_value
modifiers with amounts of 2
and 4
, to attribute base of 3
:
Total
= 3
+ 2
+ 4
= 9
add_multiplied_base
(+- amount
, additive
)
Multiplies the base attribute by (1 + sum of modifiers' amounts).
Total
= Base
× ( 1
+ Amount1
+ Amount2
+ …
+ Amount
n)
For example, applying two add_multiplied_base
modifiers with amounts of 2
and 4
, to attribute base of 3
:
Total = 3
× ( 1
+ 2
+ 4
) = 3
× 7
= 21
add_multiplied_total
( + - amount
, multiplicative
)
Multiplies the base attribute by ( 1
+ modifiers' amounts
) for every modifier.
Total
= Base
× ( 1
+ Amount1
) × ( 1
+ Amount2
) × …
× ( 1
+ Amount
n )
For example, applying two add_multiplied_total modifiers with amounts of 2
and 4
, to attribute base of 3
:
Total
= 3
× ( 1
+ 2
) × ( 1
+ 4
) = 3
× 3
× 5
= 45
/give @p paper[attribute_modifiers=[{id:"armor",type:"armor",amount:1,operation:"add_value",slot:"chest"},{id:"armor_toughness",type:"armor_toughness",amount:1,operation:"add_value",slot:"chest"}]] 1
When present, the player holding the item will be able to break the specified blocks in adventure mode.
Component Values
blocks
Can be a block ID or a block tag with a #
, or a list of block IDs.
nbt
state
The block state properties to match
A key-value pair, where the key is a block state key and the value is a block state value to match, for example facing: "east"
.
show_in_tooltip
Show or hide the "Can break" line on this item's tooltip. Defaults to true
/give @p paper[can_break={predicates:[{blocks:'black_concrete','coal_ore'},{blocks:'gravel'}],show_in_tooltip:true}]
blocks
Can be a block ID or a block tag with a #
, or a list of block IDs.
nbt
state
The block state properties to match
A key-value pair, where the key is a block state key and the value is a block state value to match, for example facing: "east"
.
show_in_tooltip
Show or hide the "Can break" line on this item's tooltip. Defaults to true
/give @p paper[can_place_on={predicates:[{blocks:'black_concrete','coal_ore'},{blocks:'bell'}],show_in_tooltip:true}] 1
If present, the item can be consumed. Its options can also be modified.
consume_seconds
The amount of seconds it takes for a player to consume the item. Defaults to 1.6
.
animation
The animation used during consumption of the item. Must be one of none
, eat
, drink
, block
, bow
, spear
, crossbow
, spyglass
, toot_horn
or brush
. Defaults to eat
sound
One sound event (an [String] ID, or a new [NBT Compound / JSON Object] sound event definition) used during and on completion of the item's consumption. Defaults to entity.generic.eat
has_consume_particles
Whether consumption particles are emitted while consuming this item. Defaults to true
.
on_consume_effects
A list of effects which take place as a result of consuming this item. Optional.
teleport_randomly
Value in Floats to teleport the player like a Chorus Fruit
type
The kind of consume effect. Must be one of apply_effects
, remove_effects
, clear_all_effects
, teleport_randomly
or play_sound
If type is apply_effects
Applies effects on the consumer.
probability
The chance for the above effects to be applied once consumed. Must be a positive float between 0.0 and 1.0. Defaults to 1.0.
(If type is teleport_randomly)
diameter
The diameter that the consumer is teleported within. Defaults to 16.0.
id
The ID of the effect.
amplifier
The amplifier of the effect, with level I having value 0. Optional, defaults to 0
duration
The duration of the effect in ticks. Value -1 is treated as infinity. Values 0 or less than -2 are treated as 1. Optional, defaults to 1 tick.
ambient
Whether or not this is an effect provided by a beacon and therefore should be less intrusive on the screen. Optional, defaults to false
.
show_particles
Whether or not this effect produces particles. Optional, defaults to true
show_icon
Whether or not an icon should be shown for this effect. Optional, defaults to true
/give @p paper[consumable={consume_seconds:1.6,animation:"brush",sound:"entity.egg.throw",has_consume_particles:true}] 1
/give @p paper[consumable={consume_seconds:1.6,animation:"brush",sound:"entity.egg.throw",has_consume_particles:true,on_consume_effects:[{type:"minecraft:remove_effects",effects:["minecraft:instant_damage"]},{type:"minecraft:apply_effects",effects:[{id:"minecraft:luck",amplifier:1,duration:20,show_particles:1b,show_icon:1b,ambient:1b}],probability:0.5},{type:"minecraft:teleport_randomly",diameter:0},{type:"minecraft:play_sound",sound:"block.azalea.break"}]}] 1
Contains key-value pairs of any custom data not used by the game, either as an object or a SNBT string.
<key>
A key-value pair, where the value can have any data type, including another compound
/give @p paper[custom_data={elitefantasy:idontknow}] 1
floats
A list of floats
for the range_dispatch
model type. Missing values return the fallback
model.
flags
A list of booleans
for the condition
model type. Missing value returns the is_false
model.
strings
A list of strings
for the select
model type. Missing value returns the fallback
model.
colors
A list of RGB values or number providers for the model
model type's tints
. Missing value returns the default
value provided by the item model definition. Can either be a list of lists, or an int array. When provided as a list, it will automatically convert to an int array.
/give @p paper[custom_model_data={floats:[100],flags:[condition123],strings:["hi1234"],colors:[I;8270847]}] 1
Used to specify the item's custom name, like you can in an anvil. This component:
has a higher priority over the item_name
component
can be renamed or removed using an anvil
if unspecified otherwise, the item's name will default to being italic.
/give @p paper[custom_name='{"bold":true,"color":"dark_gray","font":"minecraft:default","italic":false,"obfuscated":false,"strikethrough":false,"text":"HIIIIIIIIIIIIII","underlined":false}'] 1
Specifies the amount of durability lost (not remaining) from the item
The number of uses consumed (not remaining) of the item's durability. Must be a non-negative integer, defaults to 0.
/give @p diamond_axe[damage=500]
Items with this component, when thrown on the ground, will be resistant to the damage types included in the component's damage tag.
This component also affects whether the equipped item will be damaged when the wearer is hurt by the given damage type.
/give @p paper[damage_resistant={types:"#minecraft:is_explosion"}] 1
If present, this item acts like a totem of undying, by reviving the holder of this item.
/give @p paper[death_protection={death_effects:[{type:"minecraft:clear_all_effects"},{type:"minecraft:teleport_randomly",diameter:0},{type:"minecraft:play_sound",sound:"block.azalea.break"}]}] 1
If present, this item can be equipped in the specified slot
slot (1.21.5)
The slot to put the item on. Can be one of head
, chest
, legs
, feet
, body
, mainhand
, offhand
or saddle
equip_sound
One sound event or a new [NBT Compound / JSON Object] sound event definition) to play when the item is equipped. Defaults to item.armor.equip_generic
asset_id
The resource location of the equipment model to use when equipped. The directory this refers to is assets/<namespace>/equipment/<id>.json
. If not specified, falls back to rendering as the item itself when in the head slot (if not applicable, the item does not render).
allowed_entities
Entity ID, Entity Tag, or list of Entity IDs to limit which entities can equip this item. Defaults to all entities
dispensable
Whether the item can be dispensed by using a dispenser. Defaults to true
swappable
Whether the item can be equipped into the relevant slot by right-clicking. Defaults to true
damage_on_hurt
Whether this item is damaged when the wearing entity is damaged. Defaults to true
equip_on_interact (1.21.5)
Whether this item can be equipped onto a target mob by pressing use on it (as long as this item can be equipped on the target at all). Defaults to true
camera_overlay
The resource location of the overlay texture to use when equipped. The directory this refers to is assets/<namespace>/textures/<id>
/give @p paper[equippable={slot:"chest",equip_sound:"block.anvil.break",asset_id:"minecraft:elitefantasy_cactus",allowed_entities:"minecraft:zombie",dispensable:true,swappable:true,damage_on_hurt:true}] 1
Defines the item model of this item.
The resource location of the item, which references the item model definition /assets/<namespace>/items/<id>
without the .json suffix.
/give @p paper[item_model="minecraft:paper"] 1
Makes the item like a shield, blocking attacks when used
block_delay_seconds
The amount of time (in seconds) that use must be held before successfully blocking attacks. Defaults to 0
.
disable_cooldown_scale
The multiplier applied to the number of seconds that the item will be on cooldown for when attacked by a disabling attack (The multiplier for [Float] disable_blocking_for_seconds on the minecraft:weapon
component). If set to 0
, this item can never be disabled by attacks. Defaults to 1
.
block_sound
One sound event, or a new [NBT Compound / JSON Object] sound event definition) to play when an attack is successfully blocked. Defaults to none.
disabled_sound
One sound event, or a new [NBT Compound / JSON Object] sound event definition) to play when the item goes on its disabled cooldown due to an attack. Defaults to none.
bypassed_by
a damage type tag with #
of damage types that bypass the blocking. Defaults to none.
Controls how much damage should be blocked in a given attack.
type
base
The constant amount of damage to be blocked.
factor
The fraction of the dealt damage to be blocked.
horizontal_blocking_angle
strictly positive float — The maximum angle between the users facing direction and the direction of the incoming attack to be blocked. Defaults to 90
threshold
The minimum amount of damage dealt by the attack before item damage is applied to the item.
base
The constant amount of damage applied to the item, if threshold is passed.
factor
The fraction of the dealt damage that should be applied to the item, if threshold is passed.
horizontal_blocking_angle
strictly positive float — The maximum angle between the users facing direction and the direction of the incoming attack to be blocked. Defaults to 90
/give @p paper[blocks_attacks={block_delay_seconds:1,disable_cooldown_scale:1,bypassed_by:"#is_explosion",damage_reductions:[{base:5,factor:5,horizontal_blocking_angle:180}],item_damage:{threshold:1,base:1,factor:1},block_sound:"block.calcite.hit",disable_sound:"block.amethyst_cluster.break"}] 1
.
[upcoming ]
NBT to match. See .
NBT to match. See .
Specifies the custom model data, which can be read by a resource pack's model by
To convert RGB values to int use
Text component to use as this item's name. See .
If specified, this item is invulnerable to the specified damage types when in or equipped.
types
A prefixed with #
.
Any number of (s) (an [String] ID, or a [String] tag with #
, or an [NBT List / JSON Array] array containing [String] IDs) to block. Defaults to all damage types.