What does /give do?
The give command adds an item to a player’s inventory. Choose a player, an item ID, and an amount to receive building materials, equipment, and more.
Commands require cheats or appropriate server permissions.
Basic syntax
/give <target> <item_id> [amount]Angle brackets mark required arguments; square brackets mark optional ones. Do not type the brackets. Omitting the amount gives one item.
| Argument | Meaning |
|---|---|
| Target | A player name or selector such as @s, @p, or @a. |
| Item ID | minecraft:diamond is an identifier, rather than the item’s display name. |
| Amount | How many items to give. The prototype generator accepts 1–64. |
Choosing a target
| Selector | Recipient |
|---|---|
@s | The executor: yourself when running from chat. |
@p | The player nearest to the execution position. |
@a | All players. Each receives the specified amount. |
@r | A randomly selected player. |
A command block is not a player, so @s in a command block does not give an item to a player. Use @p or a player name instead.
Examples
Give the nearest player 64 oak planks
/give @p minecraft:oak_planks 64Open these settings in the generator →Data components
Append [component=value] to the item ID. Separate multiple components with commas. Available components depend on your game version.
| Setting | Effect | From |
|---|---|---|
custom_name | Changes the item’s display name. | 1.20.5 |
unbreakable | Prevents durability loss. | 1.20.5 |
attack_animation | Sets the animation played when attacking with the item. | 26.3 |
attack_range | Sets attack reach and the target hitbox margin. | 1.21.11 |
attribute_modifiers | Changes equipped attributes. The supplied list replaces the item’s default modifiers. | 1.20.5 |
banner_patterns | Adds patterns to banners and shields in the order shown. | 1.20.5 |
base_color | Sets the base color of a shield. | 1.20.5 |
bees | Sets the bees stored in a beehive or bee nest. | 1.20.5 |
block_entity_data | Sets the NBT applied to the block entity when placed. | 1.20.5 |
block_state | Sets the properties of the block when placed. | 1.20.5 |
block_transformer | Selects the transformation used when interacting with a block. | 26.3 |
blocks_attacks | Sets how the item blocks attacks like a shield. | 1.21.5 |
break_sound | Sets the sound played when the item breaks. | 1.21.5 |
brewing_fuel | Sets how many brews a fuel item provides and the brewing speed. | 26.3 |
bucket_entity_data | Sets the NBT of the entity released from the bucket. | 1.20.5 |
bundle_contents | Sets the item stacks stored in the bundle. | 1.20.5 |
can_break | Sets which blocks the item can break in Adventure mode. | 1.20.5 |
can_place_on | Sets the blocks this item can be placed on in Adventure mode. | 1.20.5 |
charged_projectiles | Sets the projectile stacks loaded into a crossbow. | 1.20.5 |
compostable | Sets the layers added to a composter. | 26.3 |
consumable | Sets how the item is consumed and which effects it triggers. | 1.21.2 |
container | Sets the item stack in each specified container slot. | 1.20.5 |
container_loot | Sets the loot table and seed used to generate container contents. | 1.20.5 |
cooking_fuel | Sets fuel burn time and cooking speed. | 26.3 |
custom_model_data | Sets data used by resource packs to select item models. | 1.20.5 |
damage | Sets the amount of durability already lost. | 1.20.5 |
damage_type | Sets the damage type dealt when attacking with the item. | 1.21.11 |
damage_resistant | Sets the damage types the item entity can resist. | 1.21.2 |
death_protection | Protects against lethal damage and sets the effects on activation. | 1.21.2 |
debug_stick_state | Sets the debug stick’s selected property for each block. | 1.20.5 |
dye | Sets the item’s dye color. | 26.1 |
dyed_color | Sets the dyed color of items such as leather armor. | 1.20.5 |
enchantable | Sets an item’s enchantability at an enchanting table. | 1.21.2 |
enchantment_glint_override | Explicitly enables or disables an item’s glint. | 1.20.5 |
enchantments | Sets the item’s enchantments and their levels. | 1.20.5 |
entity_data | Sets the NBT applied to the entity spawned by the item. | 1.20.5 |
equippable | Sets the equipment slot, appearance, and behavior. | 1.21.2 |
fireworks | Sets flight duration and the ordered explosion list. | 1.20.5 |
firework_explosion | Sets the shape, colors, trail, and twinkle of a firework star. | 1.20.5 |
food | Sets the hunger and saturation restored by the item. | 1.20.5 |
glider | Allows gliding while the item is equipped. | 1.21.2 |
instrument | Uses a registered instrument ID or an inline instrument definition. | 1.20.5 |
intangible_projectile | Prevents the projectile from being picked up after it is fired. | 1.20.5 |
interact_animation | Sets the animation played when interacting with the item. | 26.3 |
item_model | Sets the model ID used to render the item. | 1.21.2 |
item_name | Sets the item’s default display name. | 1.20.5 |
jukebox_playable | Sets the song the item plays in a jukebox. | 1.21 |
kinetic_weapon | Sets timing, conditions, and sounds for charge attacks. | 1.21.11 |
lock | Sets the item required to unlock the container. | 1.20.5 |
lodestone_tracker | Sets the compass target and whether the lodestone is tracked. | 1.20.5 |
lore | Sets the tooltip description one line at a time. | 1.20.5 |
map_decorations | Sets the icons and positions of map markers. | 1.20.5 |
map_id | Sets the ID of the map data used by the item. | 1.20.5 |
max_damage | Sets maximum durability. Damageable items require damage and a maximum stack size of 1. | 1.20.5 |
max_stack_size | Sets the maximum number of items in a stack. | 1.20.5 |
minimum_attack_charge | Sets the minimum attack charge required before attacking. | 1.21.11 |
mob_visibility | Changes detection distance for the specified mobs while equipped. | 26.3 |
note_block_sound | Sets the sound played by the note block. | 1.20.5 |
ominous_bottle_amplifier | Sets the ominous bottle’s effect level minus one. | 1.20.5 |
piercing_weapon | Sets knockback, dismounting, and sounds for piercing attacks. | 1.21.11 |
pot_decorations | Sets the decoration on each of the four sides of the pot. | 1.20.5 |
potion_contents | Sets the base potion, color, and additional effects. | 1.20.5 |
potion_duration_scale | Scales the duration of the potion’s status effects. | 1.21.5 |
profile | Sets the player profile and appearance used by player heads and other items. | 1.20.5 |
provides_banner_patterns | Sets the banner patterns available in a loom. | 1.21.5 |
provides_pottery_pattern | Sets the pattern applied when the item is used on a decorated pot. | 26.3 |
provides_trim_material | Sets the registered trim material ID used at a smithing table. | 1.21.5 |
rarity | Sets the item rarity and its default name color. | 1.20.5 |
recipes | Sets the recipes unlocked by items such as a knowledge book. | 1.20.5 |
repairable | Sets the materials that can repair the item in an anvil. | 1.21.2 |
fire_resistant | Prevents dropped items from burning up in fire. | 1.20.5 |
hide_additional_tooltip | Hides the additional tooltip information for the item type. | 1.20.5 |
hide_tooltip | Hides the entire tooltip, including the item name. | 1.20.5 |
map_color | Sets the tint of the markings on the filled map item model. | 1.20.5 |
swing_animation | Sets the swing animation used when attacking or interacting with the item. | 1.21.11 |
repair_cost | Sets the prior-work penalty charged by an anvil. | 1.20.5 |
sign_text_back | Sets the four lines on the back of a sign. | 26.3 |
sign_text_front | Sets the four lines on the front of a sign. | 26.3 |
stored_enchantments | Sets the enchantments stored on an item such as an enchanted book. | 1.20.5 |
sulfur_cube_content | Sets the stack absorbed by the sulfur cube in the bucket. | 26.2 |
suspicious_stew_effects | Sets the status effects applied when the stew is eaten. | 1.20.5 |
tool | Sets mining speed, correct-tool rules, and durability used when mining. | 1.20.5 |
tooltip_display | Hides the entire tooltip or selected component details. | 1.21.5 |
tooltip_style | Sets the tooltip style supplied by a resource pack. | 1.21.2 |
trim | Selects the armor trim material and pattern. | 1.20.5 |
use_cooldown | Sets the delay after use and the optional shared cooldown group. | 1.21.2 |
use_effects | Sets sprinting, movement speed, and vibration behavior while using the item. | 1.21.11 |
use_remainder | Sets the item stack left after the item is used up. | 1.21.2 |
villager_food | Sets how much hunger the item restores when a villager eats it. | 26.3 |
waxed | Waxes a sign or similar block to lock its editable contents. | 26.3 |
weapon | Sets durability used per attack and the duration of blocking disable. | 1.21.5 |
writable_book_content | Sets the plain text on each page of a book and quill. | 1.20.5 |
written_book_content | Sets the title, author, and pages of a written book. | 1.20.5 |
Version syntax and generators
The syntax for custom_name changed in Java 1.21.5. Choose the generator for the version you play.
Java 1.21.5 and later (SNBT)
/give @s minecraft:diamond_sword[minecraft:custom_name={text:"Vivian’s sword"},minecraft:unbreakable={}] 1
Java 1.20.5–1.21.4 (JSON string)
/give @s minecraft:diamond_sword[minecraft:custom_name="{\"text\":\"Vivian’s sword\"}",minecraft:unbreakable={}] 1
| Version | Generator | Example |
|---|---|---|
| Java 26.3– | Open generator | Open example |
| Java 26.2 | Open generator | Open example |
| Java 26.1 | Open generator | Open example |
| Java 1.21.11 | Open generator | Open example |
| Java 1.21.9–1.21.10 | Open generator | Open example |
| Java 1.21.6–1.21.8 | Open generator | Open example |
| Java 1.21.5 | Open generator | Open example |
| Java 1.21.4 | Open generator | Open example |
| Java 1.21.2–1.21.3 | Open generator | Open example |
| Java 1.21–1.21.1 | Open generator | Open example |
| Java 1.20.5–1.20.6 | Open generator | Open example |
Removing and emptying components
Choose an output mode below the component name. Available modes depend on the component and game version. A blank normal input is omitted. Remove adds !component_name and requires Java 1.21 or later.
/give @s minecraft:diamond_sword[!minecraft:custom_name,!minecraft:unbreakable] 1Open these settings in the generator →Empty outputs a value such as {} or [] according to the component schema. custom_name={} has not been validated in-game. Your normal input is preserved while using either mode.
This give command creates a new item with the selected settings. It does not modify an existing item in your inventory.
Troubleshooting
I don’t have permission to run the command
Check whether cheats are enabled for the world. On a server, ask the administrator to check your permissions.
The item ID is rejected
Use the item ID rather than a translated display name. Check the spelling and whether that item exists in your edition and version.
Can I add names and enchantments?
In Java Edition, you can set an item name or add enchantments. If the command fails, check that the selected syntax matches your game version.
Make your own command
Choose a recipient, an item, and an amount, then copy your command.
Open the give generator →