nocware

nocware › Blog › How to Use the /give Command

How to Use the /give Command

Get any item, from simple stacks to custom gear.

A command block surrounded by a diamond sword, an enchanted book, a potion and a diamond
Quick answer
  • Basic use: /give @s diamond 64 gives you 64 diamonds.
  • On Java 1.20.5 and newer, custom items use [components] after the item name.
  • You need cheats on (single player) or operator permission on a server.

/give is the fastest way to get any item, including ones you can't get in Survival. Here's how it works, from simple to fancy.

Give Command GeneratorMake Minecraft /give commands for custom items: coloured names, lore, any enchantments and levels, unbreakable and glint

The basic command

PartExampleMeaning
Command/giveGive an item
Target@sWho gets it (see below)
Itemdiamond_swordThe item's ID
Amount1How many (optional)

Who gets it

  • @s yourself
  • @p the nearest player
  • @a every player
  • @r a random player
  • Or type a player's name

Custom items on Java

Since Java 1.20.5, extra details go in square brackets right after the item ID. These are called components.

WantCommand
Enchanted sword/give @s diamond_sword[enchantments={"minecraft:sharpness":5}]
Item with lore/give @p diamond_sword[lore=["Example"]]
Night Vision potion/give @a potion[potion_contents={potion:"minecraft:night_vision"}]
Old commands won't workCommands from videos before 1.20.5 use the old {curly bracket} format. Newer versions reject them, so check what version a command was made for.
Skip the typingBrackets and quotes are easy to get wrong. The give command generator builds the whole thing for you: coloured names, lore, any enchantment level and unbreakable items.

Bedrock

Bedrock uses a different layout: /give player item amount data components. Components are written in JSON, for example keeping an item on death:

/give @p diamond_sword 1 0 {"keep_on_death":{}}

Turning cheats on

  • Single player: open to LAN with cheats on, or turn on cheats when creating the world.
  • Servers: you need operator (op) permission.
Hardcore and cheatsHardcore worlds are made with cheats off. Using /give in one kind of defeats the point of a one-life run.

Cheat sheet

  • /give @s item amount
  • Java 1.20.5+: item[components]
  • Bedrock: JSON components at the end
  • Needs cheats or op
Give Command GeneratorMake Minecraft /give commands for custom items: coloured names, lore, any enchantments and levels, unbreakable and glint

More guides

All guides →

Free Minecraft tools

See all 30 tools →

Made by nocware, a Hardcore Minecraft streamer. One life, live Mon, Wed and Fri at 6pm UK.