Enchantment Command Generator
This enchantment command generator writes the command for you. Choose an item, set any enchantment level up to 255, and copy a working /give command. Survival-legal picks also get an /enchant command.
Item
Enchantments
Commands
/give
/enchant
How to use it
- Choose the item, or tick Enchanted book.
- Set the levels: Max for survival levels, 255 for the highest the game allows, or type any number.
- Copy the /give command; survival-legal picks also get /enchant commands.
Good to know
- Run commands from a command block for levels and items that can't be typed in chat.
- Over-max enchantments still follow the 80% protection cap and other limits.
- For Bedrock, only /enchant up to the max level works.
Related: God armor generator, Max enchantment levels, and the enchantment calculator for the cheapest anvil order.
How the commands work
Since Java 1.21.5 enchantments are an item component: /give @p netherite_sword[enchantments={sharpness:5,looting:3}]. Books use stored_enchantments instead. Levels can go up to 255.
/enchant is stricter: it only works on the item in the player's hand, up to the normal max level, and refuses conflicting enchantments.
On Bedrock Edition only /enchant works, also limited to the max level: for example /enchant @s sharpness 5.
The syntax in each Java version
The /give format changed twice in recent years. So a command from an old video often fails in a new world. Match the command to your version:
| Java version | Sword with Sharpness V | Mending book |
|---|---|---|
| 1.21.5 and newer | /give @p diamond_sword[enchantments={sharpness:5}] | /give @p enchanted_book[stored_enchantments={mending:1}] |
| 1.20.5 to 1.21.4 | /give @p diamond_sword[enchantments={levels:{sharpness:5}}] | /give @p enchanted_book[stored_enchantments={levels:{mending:1}}] |
| 1.13 to 1.20.4 | /give @p diamond_sword{Enchantments:[{id:"minecraft:sharpness",lvl:5s}]} | /give @p enchanted_book{StoredEnchantments:[{id:"minecraft:mending",lvl:1s}]} |
This tool writes the newest format, which works in Java 26.3.
Reading a /give command
@ptargets the nearest player. Use@sfor yourself,@afor everyone, or type a player name.- The item id comes next, like
netherite_sword. Theminecraft:prefix is optional. - The square brackets hold item components. Inside
enchantments, each entry is an id, a colon and a level. - Separate entries with commas and no spaces, for example
{sharpness:5,looting:3,mending:1}. - Add more components in the same brackets. For example,
unbreakable={}stops the item from taking damage. - Also,
enchantment_glint_override=trueadds the glint without any enchantment. - For a colored name, add
custom_name; the anvil color names tool writes that part.
Common errors and fixes
- An error right after the item id usually means the wrong format for your version. Check the table above.
- "Unknown or incomplete command" in a single-player world means cheats are off. Open the world to LAN with cheats on, or use a command block.
- Chat takes at most 256 characters. A full god kit command can be longer, so paste it into a command block instead.
- Use ids, not display names:
binding_curse, not "Curse of Binding". The tool always writes the right id. - Levels must run from 1 to 255. A level of 0, or anything higher than 255, breaks the command.
- /enchant fails if the item can't take the enchantment, if the level is above the normal max, or if the item already has a conflicting one. Use /give in those cases.
Useful variations
/give @ainstead of@phands a copy to every player online, which suits event prizes.- Add a number after the brackets for several copies, for example
... 3for three swords. - To put an item straight into a slot, use
/item replace entity @s weapon.mainhand withand then the item part of the command. - The armor slots for that command are
armor.head,armor.chest,armor.legsandarmor.feet. - From a command block,
@pmeans the player nearest to the block, so stand close when you press the button.
What over-max levels really do
Most enchantments keep scaling past their survival max, but some stop. Sharpness adds 0.5 damage per level plus 0.5, so Sharpness X adds 5.5 and Sharpness 255 adds 128. Unbreaking on a tool skips durability loss with a chance of level in (level + 1), so an Unbreaking 255 tool loses durability on about one use in 256.
Protection is different. Protection points stop at 20 (80% less damage), and Protection IV on all four pieces already gives 16. So Protection 255 only lifts you from 64% to 80% less damage. The armor calculator shows the cap at work.
Also, an over-max book from /give does not stay over-max in survival. If you put a Sharpness X book on a sword in an anvil, the anvil caps the result at Sharpness V.
Questions
How do I give an enchanted book with a command?
Use stored_enchantments instead of enchantments, for example /give @p enchanted_book[stored_enchantments={mending:1}]. The book then works on an anvil like any other.
Why does /enchant say the item cannot support that enchantment?
The item in your hand cannot take it in survival, like Sharpness on a pickaxe. A /give command can still add it.
What do @p, @s and @a mean?
@p is the nearest player, @s is whoever runs the command, @a is every player and @r is a random player.
How do I make an item unbreakable with a command?
Add unbreakable={} inside the brackets, for example /give @p diamond_pickaxe[unbreakable={}]. It then never loses durability.
Why does chat say my command is too long?
Chat accepts at most 256 characters. Paste long commands into a command block, which takes far longer ones.
What is the highest enchantment level in Minecraft?
With commands, 255. In survival every enchantment has its own max, from I (Mending, Silk Touch) to V (Sharpness, Efficiency, Power).
Why does my old /give command not work?
The format changed in Java 1.20.5 and again in 1.21.5. Old NBT commands like {Enchantments:[{id:...}]} no longer work; use the component format this tool makes.
How do I get Sharpness 1000?
You can't: the game caps enchantment levels at 255. Sharpness 255 adds 128 damage per hit.