Skip to content

Type to search across every guide and reference page.

CommandsBoth · 26.x

Minecraft /give Command: Enchanted, Named Item Examples

/give @s diamond 64 works on both editions. For enchanted or named items, Java 1.20.5+ uses item components and Bedrock uses JSON. Syntax, examples.

By minecraft.bd Editorial Team·Updated

/give puts any item straight into a player’s inventory. The basic form is the same on both editions: /give @s diamond 64. The editions split once you want enchantments, names or other custom data. Java uses item components in square brackets, while Bedrock accepts only a handful of JSON components. Cheats must be on (see how to enable cheats).

/give syntax

Java Edition

/give <targets> <item>[<components>] [<count>]

Bedrock Edition

/give <player> <itemName> [amount] [data] [components]
  • targets/player is a name or a selector: @s (you), @p (nearest player), @a (everyone), @r (random player).
  • item is the item ID. The minecraft: prefix is optional: diamond and minecraft:diamond both work.
  • count defaults to 1. Java caps one command at 100 stacks’ worth; Bedrock accepts up to 32767.
  • data on Bedrock is a legacy aux value, normally 0. You need to fill it in if you want to add components after it.

Simple examples (both editions)

/give @s diamond 64
/give @a cooked_beef 16
/give @p elytra
/give Steve netherite_pickaxe

Java: item components (1.20.5 and later)

Since 1.20.5, custom item data goes in square brackets right after the item ID, with no space. These examples use the current format (1.21.5 and newer):

/give @s diamond_sword[enchantments={sharpness:5,looting:3,unbreaking:3,mending:1}]
/give @s netherite_pickaxe[enchantments={efficiency:5,fortune:3},unbreakable={}]
/give @s diamond_sword[custom_name="Excalibur"]
/give @s diamond_sword[custom_name={text:"Excalibur",color:"gold",italic:false}]
/give @s stick[lore=["Found in the stronghold"]]
/give @s potion[potion_contents={potion:"minecraft:night_vision"}]
/give @s totem_of_undying[max_stack_size=64] 64

On 1.20.5 to 1.21.4, two things look different: enchantments sit inside a levels wrapper, and text like names is a JSON string inside single quotes.

/give @s diamond_sword[enchantments={levels:{sharpness:5}}]
/give @s diamond_sword[custom_name='{"text":"Excalibur"}']

You can go past normal enchantment caps with components, such as sharpness:10. The /enchant command refuses that. For every enchantment ID, see the enchantment IDs list.

Bedrock: JSON components

Bedrock supports four components, written as JSON after the data value:

/give @s diamond_pickaxe 1 0 {"minecraft:can_destroy":{"blocks":["stone","iron_ore"]}}
/give @s stone 64 0 {"minecraft:can_place_on":{"blocks":["grass_block"]}}
/give @p diamond_sword 1 0 {"keep_on_death":{}}
/give @a compass 1 0 {"item_lock":{"mode":"lock_in_inventory"}}

can_destroy and can_place_on matter in adventure mode maps. keep_on_death keeps the item when the player dies, and item_lock stops players dropping or moving it (lock_in_slot pins it to one hotbar slot).

Common mistakes

  • Old NBT syntax on new Java. {Enchantments:[{id:sharpness,lvl:5}]} stopped working in 1.20.5. Use components.
  • A space before the bracket. diamond_sword [enchantments=...] fails; the bracket must touch the item ID.
  • Using the display name. It’s cooked_beef, not “Steak”, and ender_pearl, not “enderpearl”.
  • Forgetting the data value on Bedrock. {...} must come after both amount and data: 1 0 {...}.
  • Giving command blocks without permission. You need operator rights; see command blocks for setup.

For mobs instead of items, use /summon. Every other command is on the commands hub.

Common questions

How do you give yourself an enchanted item on Java 1.21?

Add an enchantments component after the item ID, for example /give @s diamond_sword[enchantments={sharpness:5}]. On 1.20.5 to 1.21.4 the component needs a levels wrapper: [enchantments={levels:{sharpness:5}}].

Why does my old /give command with curly braces no longer work?

Java 1.20.5 replaced item NBT like {Enchantments:[...]} with item components in square brackets. Commands written for 1.20.4 or older have to be rewritten in the new format.

Can Bedrock /give make enchanted or named items?

No. Bedrock /give only accepts four JSON components: can_place_on, can_destroy, item_lock and keep_on_death. Use /enchant afterwards, or an anvil to rename.

Sources & verification

Facts on this page are checked against these references and in-game behavior for the stated edition(s). how we verify.

Keep reading