Vivian’s Minecraft ToolsSMALL TOOLS. BIG ADVENTURES.
GIVE COMMAND GUIDE

How to use give (Java Edition)

From basic syntax to practical examples. Get comfortable with the give command.

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.

ArgumentMeaning
TargetA player name or selector such as @s, @p, or @a.
Item IDminecraft:diamond is an identifier, rather than the item’s display name.
AmountHow many items to give. The prototype generator accepts 1–64.

Choosing a target

SelectorRecipient
@sThe executor: yourself when running from chat.
@pThe player nearest to the execution position.
@aAll players. Each receives the specified amount.
@rA 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 yourself one diamond

/give @s minecraft:diamond 1Open these settings in the generator →

Give the nearest player 64 oak planks

/give @p minecraft:oak_planks 64Open these settings in the generator →

Give each player three apples

/give @a minecraft:apple 3Open 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.

SettingEffectFrom
custom_nameChanges the item’s display name.1.20.5
unbreakablePrevents durability loss.1.20.5
attack_animationSets the animation played when attacking with the item.26.3
attack_rangeSets attack reach and the target hitbox margin.1.21.11
attribute_modifiersChanges equipped attributes. The supplied list replaces the item’s default modifiers.1.20.5
banner_patternsAdds patterns to banners and shields in the order shown.1.20.5
base_colorSets the base color of a shield.1.20.5
beesSets the bees stored in a beehive or bee nest.1.20.5
block_entity_dataSets the NBT applied to the block entity when placed.1.20.5
block_stateSets the properties of the block when placed.1.20.5
block_transformerSelects the transformation used when interacting with a block.26.3
blocks_attacksSets how the item blocks attacks like a shield.1.21.5
break_soundSets the sound played when the item breaks.1.21.5
brewing_fuelSets how many brews a fuel item provides and the brewing speed.26.3
bucket_entity_dataSets the NBT of the entity released from the bucket.1.20.5
bundle_contentsSets the item stacks stored in the bundle.1.20.5
can_breakSets which blocks the item can break in Adventure mode.1.20.5
can_place_onSets the blocks this item can be placed on in Adventure mode.1.20.5
charged_projectilesSets the projectile stacks loaded into a crossbow.1.20.5
compostableSets the layers added to a composter.26.3
consumableSets how the item is consumed and which effects it triggers.1.21.2
containerSets the item stack in each specified container slot.1.20.5
container_lootSets the loot table and seed used to generate container contents.1.20.5
cooking_fuelSets fuel burn time and cooking speed.26.3
custom_model_dataSets data used by resource packs to select item models.1.20.5
damageSets the amount of durability already lost.1.20.5
damage_typeSets the damage type dealt when attacking with the item.1.21.11
damage_resistantSets the damage types the item entity can resist.1.21.2
death_protectionProtects against lethal damage and sets the effects on activation.1.21.2
debug_stick_stateSets the debug stick’s selected property for each block.1.20.5
dyeSets the item’s dye color.26.1
dyed_colorSets the dyed color of items such as leather armor.1.20.5
enchantableSets an item’s enchantability at an enchanting table.1.21.2
enchantment_glint_overrideExplicitly enables or disables an item’s glint.1.20.5
enchantmentsSets the item’s enchantments and their levels.1.20.5
entity_dataSets the NBT applied to the entity spawned by the item.1.20.5
equippableSets the equipment slot, appearance, and behavior.1.21.2
fireworksSets flight duration and the ordered explosion list.1.20.5
firework_explosionSets the shape, colors, trail, and twinkle of a firework star.1.20.5
foodSets the hunger and saturation restored by the item.1.20.5
gliderAllows gliding while the item is equipped.1.21.2
instrumentUses a registered instrument ID or an inline instrument definition.1.20.5
intangible_projectilePrevents the projectile from being picked up after it is fired.1.20.5
interact_animationSets the animation played when interacting with the item.26.3
item_modelSets the model ID used to render the item.1.21.2
item_nameSets the item’s default display name.1.20.5
jukebox_playableSets the song the item plays in a jukebox.1.21
kinetic_weaponSets timing, conditions, and sounds for charge attacks.1.21.11
lockSets the item required to unlock the container.1.20.5
lodestone_trackerSets the compass target and whether the lodestone is tracked.1.20.5
loreSets the tooltip description one line at a time.1.20.5
map_decorationsSets the icons and positions of map markers.1.20.5
map_idSets the ID of the map data used by the item.1.20.5
max_damageSets maximum durability. Damageable items require damage and a maximum stack size of 1.1.20.5
max_stack_sizeSets the maximum number of items in a stack.1.20.5
minimum_attack_chargeSets the minimum attack charge required before attacking.1.21.11
mob_visibilityChanges detection distance for the specified mobs while equipped.26.3
note_block_soundSets the sound played by the note block.1.20.5
ominous_bottle_amplifierSets the ominous bottle’s effect level minus one.1.20.5
piercing_weaponSets knockback, dismounting, and sounds for piercing attacks.1.21.11
pot_decorationsSets the decoration on each of the four sides of the pot.1.20.5
potion_contentsSets the base potion, color, and additional effects.1.20.5
potion_duration_scaleScales the duration of the potion’s status effects.1.21.5
profileSets the player profile and appearance used by player heads and other items.1.20.5
provides_banner_patternsSets the banner patterns available in a loom.1.21.5
provides_pottery_patternSets the pattern applied when the item is used on a decorated pot.26.3
provides_trim_materialSets the registered trim material ID used at a smithing table.1.21.5
raritySets the item rarity and its default name color.1.20.5
recipesSets the recipes unlocked by items such as a knowledge book.1.20.5
repairableSets the materials that can repair the item in an anvil.1.21.2
fire_resistantPrevents dropped items from burning up in fire.1.20.5
hide_additional_tooltipHides the additional tooltip information for the item type.1.20.5
hide_tooltipHides the entire tooltip, including the item name.1.20.5
map_colorSets the tint of the markings on the filled map item model.1.20.5
swing_animationSets the swing animation used when attacking or interacting with the item.1.21.11
repair_costSets the prior-work penalty charged by an anvil.1.20.5
sign_text_backSets the four lines on the back of a sign.26.3
sign_text_frontSets the four lines on the front of a sign.26.3
stored_enchantmentsSets the enchantments stored on an item such as an enchanted book.1.20.5
sulfur_cube_contentSets the stack absorbed by the sulfur cube in the bucket.26.2
suspicious_stew_effectsSets the status effects applied when the stew is eaten.1.20.5
toolSets mining speed, correct-tool rules, and durability used when mining.1.20.5
tooltip_displayHides the entire tooltip or selected component details.1.21.5
tooltip_styleSets the tooltip style supplied by a resource pack.1.21.2
trimSelects the armor trim material and pattern.1.20.5
use_cooldownSets the delay after use and the optional shared cooldown group.1.21.2
use_effectsSets sprinting, movement speed, and vibration behavior while using the item.1.21.11
use_remainderSets the item stack left after the item is used up.1.21.2
villager_foodSets how much hunger the item restores when a villager eats it.26.3
waxedWaxes a sign or similar block to lock its editable contents.26.3
weaponSets durability used per attack and the duration of blocking disable.1.21.5
writable_book_contentSets the plain text on each page of a book and quill.1.20.5
written_book_contentSets 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
VersionGeneratorExample
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.

Official: command changes in Java 1.21

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 →
Ad space (preview)