Updated:
A Mending book by version
| Version | Command |
|---|---|
| Java 1.21.5+ | /give @p minecraft:enchanted_book[stored_enchantments={mending:1}] |
| Java 1.20.5–1.21.4 | /give @p minecraft:enchanted_book[stored_enchantments={levels:{mending:1}}] |
| Java 1.13–1.20.4 | /give @p minecraft:enchanted_book{StoredEnchantments:[{id:"minecraft:mending",lvl:1s}]} |
1.20.5 moved items to components, and 1.21.5 removed the levels layer. The wrong format gives an error or a blank book.
Several enchantments
/give @p minecraft:enchanted_book[stored_enchantments={efficiency:5,unbreaking:3,mending:1}]
Separate them with commas (1.21.5+). On 1.20.5–1.21.4 put the same list inside levels:{…}; on 1.20.4 and earlier add one {id:…,lvl:…s} entry per enchantment.
stored_enchantments vs enchantments
Books need stored_enchantments. A book made with enchantments glows but its enchantments are not stored, so an anvil cannot transfer them. To enchant a tool directly, skip the book and use the enchant command generator.
Common enchantment IDs
| Enchantment | ID | Max |
|---|---|---|
| Mending | mending | I |
| Unbreaking | unbreaking | III |
| Efficiency | efficiency | V |
| Fortune | fortune | III |
| Silk Touch | silk_touch | I |
| Sharpness | sharpness | V |
| Looting | looting | III |
| Protection | protection | IV |
Using the book on an anvil
- "Too Expensive!": in Survival the anvil refuses any job costing 40 levels or more. Books above the normal maximum, such as Efficiency 10, push the cost up quickly. Creative mode has no limit.
- Conflicting enchantments: a command can put Sharpness and Smite on the same book, but the anvil only transfers the ones that fit the tool.
- Repeated anvil use: every anvil job raises the cost of the next one, so apply everything in as few steps as you can.
Common problems
- Blank book: the format does not match your version.
- Anvil refuses it: the book was made with
enchantments, or the enchantment does not fit that tool. - /enchant fails on a book: /enchant does not work on books; use /give.
- "Too Expensive!": levels above the normal maximum (up to 255 from 1.20.5) raise the anvil cost past what Survival allows.
- Bedrock: commands cannot create custom enchanted books.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.