A good enchanting setup is three machines working together: the enchanting table for raw level-30 enchants, librarian villagers for the specific books you actually want, and the anvil to combine everything onto one tool without wasting it. Most players nail the table and then ruin a perfect sword on the anvil because of a mechanic nobody explains: the prior-work penalty.
This guide covers the exact bookshelf count and placement for level-30 enchants, how to read the table, why librarians beat the table for targeted enchanting, and the anvil order that keeps your gear from going "Too Expensive."
All vanilla, Java Edition 1.21.4. No commands.
Tested on Minecraft Java Edition 1.21.4 survival. The 15-bookshelf requirement, bookshelf placement geometry, and the anvil prior-work penalty described here are current for this version.
Step 1: Build the enchanting table for level 30
To unlock the top enchanting tier you need exactly 15 bookshelves placed correctly around the table. Fewer shelves means lower maximum levels; 15 is the cap, and any more do nothing.
Materials:
- 1
Enchanting Table(4 obsidian, 2 diamonds, 1 book) - 15
Bookshelf(each is 6 planks plus 3 books, and each book is 3 paper plus 1 leather) - That is 90 planks, 45 books, so 135 paper and 45 leather total for the shelves
Placement rules, and this is where people go wrong:
- The bookshelves must sit 2 blocks away from the table, with exactly 1 block of air between each shelf and the table. If a shelf is directly adjacent to the table, it does not count.
- Shelves count on two height levels: the same level as the table and one block above it.
- The space between the table and the shelf must be air. Any solid block (a torch on the floor is fine, but a slab or block in the gap) breaks line of sight and the shelf stops counting.
The standard layout is a 5x5 ring of bookshelves, two blocks high, around the table sitting in the center with a 1-block gap. That ring holds 15 shelves on the bottom row alone, which is all you need; many builders stack a second row for looks but it adds nothing mechanically.
If your table only shows low-level enchants, the cause is almost always a blocked gap or a shelf placed flush against the table. Walk around the ring and confirm there is one air block between every shelf and the table, at both height levels.
Step 2: Read the table, but know its limits
Open the table with a tool and lapis in the slots. You get three offers, and you see only a hint of each (one enchantment name and the level cost). The actual result is partly random:
- The level cost shown (the green number) is the experience level required, and the bottom option needs level 30.
- Picking the level-30 slot tends to give the best and most enchantments, but you do not control which enchants you get. You might want
Efficiency Vand getUnbreaking IIIplusKnockback I. - Lapis lazuli is consumed: 1 to 3 per enchant depending on the slot. Keep a stack handy.
The table is great for books (cheap to enchant and you can pick the good results) and for getting raw power onto a tool fast. It is bad at giving you a specific enchantment. For that, you go to villagers.
Step 3: Use librarians for targeted enchantments
A Librarian villager (claims a Lectern) sells enchanted books, and you can reroll its offers until it sells the exact book you want.
- Set up a librarian and open its trades. The enchanted-book offer is random.
- If it is not the enchant you want, break and replace the lectern to reroll. Repeat until you see, for example, a
MendingorSharpness Vbook. - Trade once to lock that offer. Now you have an infinite, targeted source of that book.
This is the cleanest way to get Mending (which the enchanting table cannot produce at all), and the most reliable way to get max-level Protection IV, Efficiency V, Sharpness V, and similar without gambling at the table. Pair it with the zombie-cure discount and books cost one to two emeralds each.
Reroll the librarian before your first trade with it. The moment you complete any trade, the profession and trade list lock permanently and breaking the lectern no longer rerolls. Confirm the book you want is in the list, then buy.
Step 4: Combine with the anvil, and beat the prior-work penalty
The Anvil (3 iron blocks plus 4 iron ingots) merges a book onto a tool, or merges two of the same item, and lets you rename gear. The trap is the prior-work penalty.
Every time an item goes through the anvil, it gains a hidden work penalty that doubles the level cost the next time you use that item. The sequence is 1, 3, 7, 15, 31 added levels and climbing. Once the total cost exceeds 39 levels, the anvil shows "Too Expensive" and refuses the combine in survival.
That means the order you combine books matters enormously. Slapping five books onto a tool one at a time stacks five penalties and you hit "Too Expensive" fast. Instead:
- Combine books into books first. Put
Sharpness VandUnbreaking IIItogether to make one combined book. Then combine that withMending. Build up one big book. - Apply the big combined book to the tool last, ideally in a single operation. The tool itself only takes one trip through the anvil, so its prior-work penalty stays low.
- Think of it as a tournament bracket: pair books, pair the results, and only touch the tool at the final step.
This "book bracket" approach is the difference between fully enchanting a pickaxe for a reasonable cost and bricking it at "Too Expensive."
Renaming costs work-penalty too. If you plan to name a tool, do it on the very first anvil operation or on the cheap side item, not as the last step on a heavily-enchanted tool, or you may tip it over the 39-level wall.
Step 5: Fuel the whole thing with experience
Level-30 enchants cost 30 levels each, and the anvil eats levels too. You need a steady experience source:
- A simple mob farm (drowned, zombie, or a general dark-room spawner) is the standard XP engine.
- Furnace XP stacks up while you smelt; collecting a full furnace of smelted items dumps a surprising amount of experience.
- Bottles o' Enchanting from
Clericvillagers or wandering traders give XP on the spot if you have emeralds to spare.
Aim to keep a buffer above level 30 so you never wait around between enchants.
A clean all-in-one room
Put the three machines together: the bookshelf ring with the table in the center, an anvil on one side at desk height, and a couple of librarian cells in the wall feeding you books. Add a lever-controlled light and an XP farm output nearby and you have a permanent enchanting station you never have to rebuild.
Common mistakes
- Shelves placed flush against the table. They must be 2 blocks out with a 1-block air gap, on the table's level and one above. Flush shelves count for nothing.
- A solid block in the gap. Anything blocking the air between shelf and table cancels that shelf. Keep the gap clear.
- Trading the librarian before rerolling. Locks a bad book offer forever.
- Enchanting books onto tools one at a time. Stacks prior-work penalties until "Too Expensive." Build a combined book first, apply once.
- Renaming last. Adding a custom name to an already-expensive tool can push it past the 39-level cap. Name early or on cheap items.
- Forgetting lapis. The table needs lapis lazuli in addition to your levels. Keep a stack in the second slot.
FAQ
How many bookshelves do I need for level 30? Exactly 15, placed 2 blocks from the table with a 1-block air gap, on two height levels. More than 15 does nothing.
Why does my anvil say "Too Expensive"? The combined level cost exceeded 39, usually from too many prior anvil operations on that item. Combine books into one big book first, then apply to the tool in a single step.
Can I get Mending from the enchanting table?
No. Mending is treasure-only. Buy it from a librarian, fish for it, or find it in chests and raids.
Does putting more than 15 bookshelves help? No. 15 is the cap for the maximum enchant level. Extra shelves are purely decorative.
Why are my table enchants random? The table intentionally hides and randomizes results. Use librarians when you need a specific enchantment rather than gambling.
Updated for Minecraft 1.21.4 on June 16, 2026. Bookshelf geometry, the level-30 requirement, and anvil penalty values are re-checked each version and this note is updated.






