# How to Give Enchanted Items on a Minecraft Server (/give Syntax)

The /give syntax for enchanted, named and unbreakable items on a Minecraft Java server, for 1.21.5 and newer and for older versions.

Updated 2026-10-07. https://gamezservers.com/guides/how-to-give-enchanted-items-on-a-minecraft-server

To give an enchanted item on a Minecraft Java server, run `/give <player> <item>[enchantments={<enchantment>:<level>}]` as an operator, for example `/give Steve diamond_sword[enchantments={sharpness:5,unbreaking:3}]`. That is the format for Java 1.21.5 and newer, including the 26.x releases. Older versions use a different syntax, which is why so many copied commands fail with "Expected" or "Unknown item component" errors. This guide gives you the right command for your version.

## Which syntax does your server use?

Minecraft changed the item format twice in two years. Check your server version in the panel or with the `version` command, then use the matching column.

| Server version | Enchantment syntax |
|---|---|
| 1.21.5 and newer, 26.x | `diamond_sword[enchantments={sharpness:5}]` |
| 1.20.5 to 1.21.4 | `diamond_sword[enchantments={levels:{sharpness:5}}]` |
| 1.20.4 and older | `diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5s}]}` |

Square brackets mean "item components", introduced in 1.20.5. Curly braces straight after the item name mean old NBT, which current servers reject.

## Before you start

- You need operator level 2 or higher. Use the [op guide](https://gamezservers.com/guides/how-to-op-someone-on-a-minecraft-server) if `/give` says you do not have permission.
- In chat, type the leading slash. In the server console, leave it out: `give Steve diamond 64`.
- On a Paper or Purpur server with EssentialsX, plain `/give` runs the Essentials command, which has its own syntax. Use `/minecraft:give` to force the vanilla one shown here.

## Basic give commands

```
give Steve diamond 64
give @a cooked_beef 16
give @p netherite_pickaxe
```

`@a` gives to every online player, `@p` to the nearest player (from the console that is whoever is closest to world spawn), and `@s` to yourself. You can give more than one stack at once and the extra lands in the inventory or drops at the player's feet.

![A Minecraft player standing in a forest](https://gamezservers.com/games/minecraft/shot-1.jpg)

## Enchanted weapons, tools and armor (1.21.5 and newer)

Separate enchantments with commas inside the curly braces:

```
give Steve diamond_sword[enchantments={sharpness:5,unbreaking:3,mending:1,looting:3}]
give Steve netherite_pickaxe[enchantments={efficiency:5,fortune:3,unbreaking:3,mending:1}]
give Steve bow[enchantments={power:5,infinity:1,flame:1,punch:2}]
give Steve netherite_chestplate[enchantments={protection:4,unbreaking:3,mending:1}]
give Steve trident[enchantments={riptide:3,impaling:5,unbreaking:3}]
```

Levels above the normal maximum work too, up to 255:

```
give Steve diamond_sword[enchantments={sharpness:10}]
```

The game does not check whether enchantments are compatible, so `/give` can put Mending and Infinity on the same bow, or Silk Touch and Fortune on one pickaxe. In a few pairs only one of the two takes effect, so test before handing out a prize.

Enchantment names are the IDs, not the display names: `sweeping_edge`, `fire_aspect`, `feather_falling`, `respiration`, `aqua_affinity`, `depth_strider`, `frost_walker`, `soul_speed`, `swift_sneak`, `luck_of_the_sea`, `lure`, `multishot`, `piercing`, `quick_charge`, `density`, `breach` and `wind_burst`. Typing the command in the game chat helps here: press Tab after `enchantments={` and the game suggests every valid ID.

## Enchanted books

Books store their enchantments in a different component, so they can be applied at an anvil:

```
give Steve enchanted_book[stored_enchantments={mending:1}]
give Steve enchanted_book[stored_enchantments={protection:4,unbreaking:3}]
```

Using `enchantments` on a book gives a book that glows but cannot be used in an anvil, a common mistake.

## Custom names and lore

From 1.21.5, names and lore are written as text directly instead of JSON inside quotes:

```
give Steve diamond_sword[custom_name="Dragon Slayer"]
give Steve diamond_sword[custom_name={text:"Dragon Slayer",color:"gold",italic:false}]
give Steve totem_of_undying[lore=["Event prize","Season 3"]]
```

Combine components with commas inside the same square brackets:

```
give Steve diamond_sword[custom_name={text:"Dragon Slayer",color:"gold",italic:false},enchantments={sharpness:5,looting:3},unbreakable={}]
```

`unbreakable={}` makes the item never lose durability.

## Potions and tipped arrows

```
give Steve potion[potion_contents={potion:"minecraft:strong_strength"}]
give Steve splash_potion[potion_contents={potion:"minecraft:long_night_vision"}]
give Steve tipped_arrow[potion_contents={potion:"minecraft:healing"}] 32
```

The `strong_` and `long_` prefixes are the level II and extended versions.

## Commands for 1.20.5 to 1.21.4

If your server sits on 1.21.1 for a modpack, or 1.20.6, use the `levels` wrapper and JSON text:

```
give Steve diamond_sword[enchantments={levels:{sharpness:5,unbreaking:3}}]
give Steve enchanted_book[stored_enchantments={levels:{mending:1}}]
give Steve diamond_sword[custom_name='"Dragon Slayer"']
```

Note the single quotes around the double quoted name. That is the old JSON text format.

## Commands for 1.20.4 and older

The pre component NBT format, still common on modded 1.20.1 and 1.19.2 servers:

```
give Steve diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5s},{id:"minecraft:unbreaking",lvl:3s}]} 1
give Steve enchanted_book{StoredEnchantments:[{id:"minecraft:mending",lvl:1s}]} 1
give Steve diamond_sword{display:{Name:'{"text":"Dragon Slayer"}'}} 1
```

Modded enchantments use their mod's namespace, like `id:"apotheosis:capturing"` instead of `minecraft:`.

## Writing long commands without typos

Commands with names, lore and five enchantments get long, and the chat box cuts off at 256 characters. Two ways around that:

- Run the command from the server console, which has no such limit.
- Put it in a command block with `/give @s command_block`, paste the command in, and power it. Command blocks need `enable-command-block=true` in `server.properties`.

Build the command one component at a time. Add the enchantments, run it, then add the name, run it again. When it breaks, you know which part to fix.

## Common errors

| Error | Cause |
|---|---|
| `Unknown item component` | You used the 1.20.5 to 1.21.4 `levels` wrapper on 1.21.5 or newer, or a misspelled component |
| `Expected whitespace to end one argument` | Old NBT syntax on a 1.20.5 or newer server |
| `Unknown command` | Not an operator, or EssentialsX is intercepting it. Try `/minecraft:give` |
| `No player was found` | Typo in the name, or the player is offline |
| `Malformed` errors on names | JSON text on 1.21.5 or newer. Drop the single quotes |

## Doing it from the panel

On a GamezServers Minecraft server you can paste any of these into the live console in the control panel without being in the game, which is handy for event prizes when you are away from your PC. The panel also has buttons for making someone operator, whitelisting and broadcasting. If you are still hosting from your own machine and want the server up when you are not, have a look at the [Minecraft server plans](https://gamezservers.com/games/minecraft) or the [SMP hosting page](https://gamezservers.com/minecraft-smp-server-hosting).

![A Minecraft build lit up at night](https://gamezservers.com/games/minecraft/shot-5.jpg)

## FAQ

### Why does my /give command with enchantments not work?

Almost always a version mismatch in the syntax. Servers on 1.21.5 or newer need `[enchantments={sharpness:5}]`. Commands with `levels:` or with `{Enchantments:[...]}` are for older versions.

### Can I give items above the max enchantment level?

Yes, up to level 255 with `/give`. Very high levels on Protection or Sharpness can make players nearly impossible to kill, so use them for fun events, not a survival economy.

### How do I give an item to everyone on the server?

Use `@a` as the target, like `give @a golden_apple 3`. It only reaches players who are online at that moment.

### Does /give work on Bedrock servers?

Yes, but Bedrock does not accept these component formats. Bedrock uses `/give` and `/enchant` separately. See the [Bedrock server commands list](https://gamezservers.com/guides/minecraft-bedrock-server-commands).
