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 clearly: the prior-work penalty, which grows exponentially and depends on the order you combine things in.
This guide covers exact bookshelf placement for level-30 enchants, where the table simply cannot help you, why librarians beat the table for targeted enchanting, the exact anvil penalty progression with a worked example of why order changes the cost, and what the grindstone does when you need to undo a mistake. All vanilla, Java Edition 26.2, no commands.
Tested on Minecraft Java Edition 26.2 survival. The 15-bookshelf requirement, bookshelf placement geometry, and the anvil prior-work penalty numbers below are sourced from minecraft.wiki and 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 nearly everyone loses levels:
- Each bookshelf needs to sit with one block of air (or, since 1.20, a replaceable block like tall grass or a flower) between it and the table. A shelf placed flush against the table does not count at all.
- Shelves count on two height levels: the same level as the table and one block above it.
- Almost any normal block sitting in that gap blocks the bonus, and that includes a torch. This is by far the most common reason a table caps below level 30: a torch, carpet, or sign left in the one-block gap and the shelf on the other side stops counting even though it looks connected. Since 1.20, only a replaceable block (grass, flowers, saplings) is exempt; a torch is not replaceable in the sense the mechanic checks for.
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 the ring and check every gap at both height levels. If you like a torch for light, move it to the outer face of the bookshelf ring instead of the inner gap, or switch to a light source that never occupies that block, like glowstone built into the floor beneath the table.
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.
What the table can never give you. Seven enchantments are tagged as treasure enchantments and permanently excluded from the table's pool, no matter your level or luck: Mending, Frost Walker, Curse of Binding, Curse of Vanishing, Soul Speed, Swift Sneak, and Wind Burst. Mending, Frost Walker, and the two curses can still turn up as librarian trades; Soul Speed, Swift Sneak, and Wind Burst cannot even be bought from a librarian and require piglin bartering, fishing, or structure loot instead. The wiki publishes no drop-rate figure precise enough to plan around for those three, so treat it as "keep doing the activity until it shows up," not a number you can budget for.
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, and it is useless for the handful above. 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, drawn from nearly every enchantment except Soul Speed, Swift Sneak, and Wind Burst.
- If it is not the enchant you want, break and replace the lectern to reroll. Repeat until you see, for example,
MendingorSharpness V. - Trade once to lock that offer. Now you have an infinite, targeted source of that book at a price that rises a little each purchase.
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. Mending is almost always worth locking in over anything else a librarian offers first: it is treasure-only, every tool and armor piece benefits from it, and there is no other reliable way to farm it if your librarian happens to roll it. If a reroll ever shows Mending, take it before continuing to fish for something else; set up a second librarian for the next book.
Curing a zombie villager unlocks a discount. A villager converted from a zombie villager (golden apple plus weakness) trades at a permanent discount versus one that leveled up normally. Convert one librarian this way if you plan to buy a lot of books over time; the discount compounds over dozens of trades.
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, and it is worth understanding the actual numbers instead of just "combine less."
The exact penalty progression
Every time an item goes through the anvil as the base item in a combine, repair, or rename, it accumulates a hidden work-penalty counter that roughly doubles the level cost added by its next anvil use: 1, 3, 7, 15, 31 levels, at the first, second, third, fourth, and fifth operation on that item. The formula is 2^(c-1), where c is the item's anvil use count. That penalty stacks on top of whatever the enchantment itself costs, and when combining two items, the higher of the two items' penalties is what counts.
Once the total operation cost exceeds 39 levels, the anvil refuses the combine and shows "Too Expensive!" This cap applies in Survival and Adventure. Creative mode has no such cap and will let you stack past it freely.
Why order changes the cost: a worked example
This is the single most actionable fact on the whole subject. The same two final enchantments, applied in a different order, can cost wildly different amounts of experience, because the penalty attaches to whichever item has gone through the anvil more times, not to the enchantment itself.
Say you want a pickaxe with two enchantments on it, and you already have two separate enchanted books:
- Cheap path: combine the two books together first (both fresh, low penalty), producing one combined book. Apply that single book to the pickaxe as its first and only anvil trip.
- Expensive path: apply book A to the pickaxe (use count 1), then apply book B to the already-enchanted pickaxe (use count 2, so this second operation pays the doubled penalty on top of the enchant cost).
The wiki's own worked example on this exact scenario shows the same two items costing 2 levels combined one way and 12 levels the other, purely from swapping which item carries the accumulated penalty into the final step. That is a 6x cost gap from combining order alone, on identical inputs.
The book-bracket strategy
Because the penalty roughly doubles per trip and depends on which item absorbed prior operations, the cheapest way to stack several enchantments onto one tool is to treat it like a tournament bracket: combine Sharpness V and Unbreaking III into one book, combine that with Mending, and keep merging books with books, never touching the tool. Apply the final combined book to the tool last, in one operation. The tool's use count stays at 1 no matter how many enchantments end up on it.
This "book bracket" approach is the difference between fully enchanting a pickaxe for a handful of levels and bricking it at "Too Expensive" halfway through.
Renaming costs a work-penalty trip too, same as any other anvil operation. If you plan to name a tool, do it on the very first anvil operation, or on a cheap side item early in the bracket, not as the last step on a heavily-enchanted tool, or the extra operation may tip the whole combine over the 39-level wall.
Step 5: Grindstone, for undoing a mistake
The Grindstone (2 sticks, 1 stone slab, 2 wood planks) strips enchantments off a tool and, separately, clears its accumulated prior-work penalty:
- Grinding removes every enchantment (curses excepted) and returns some experience.
- Grinding also resets the prior-work penalty counter to zero, since the penalty lives on the item itself. A tool five anvil trips deep and one step from "Too Expensive" comes out clean, at the cost of losing whatever enchantments it had.
- The grindstone keeps the item's custom name, unlike a crafting-table repair, which strips penalty, enchantments, and name all at once.
Use it when a tool's penalty has climbed too high to keep enchanting economically, or when you want to start an item's anvil history over without renaming it.
Step 6: Fuel the whole thing with experience
Level-30 enchants cost 30 levels each, and the anvil eats levels too, more so once the prior-work penalty is in play. You need a steady experience source:
- A simple mob farm (drowned, zombie, or a general dark-room spawner) is the standard XP engine. See the XP farm guide for a build that scales past casual grinding.
- 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, and an emerald farm keeps that trade sustainable. - To see how long a given farm's XP rate takes to get you from your current level to 30 or further, the XP level calculator works it out for you.
Keep a buffer above level 30 so you never wait between enchants, especially once anvil penalties stack on top of enchant costs.
A clean all-in-one room
Put the three machines together: the bookshelf ring with the table in the center, an anvil at desk height, and a couple of librarian cells in the wall feeding you books. A villager trading hall built onto the same room keeps librarians and their lecterns organized; see the villager trades guide for how discounts and locking work. Keep any light source on the outer face of the bookshelf ring, not in the gap, and pipe an XP farm output nearby for a permanent station you never rebuild.
Common mistakes
- A torch, sign, carpet, or shelf placed flush against the table. Only air or a replaceable block (grass, flowers) in the 1-block gap counts since 1.20; anything else breaks that shelf's connection even though the count looks right.
- Trading a librarian before rerolling. Locks a bad book offer forever.
- Enchanting books onto a tool one at a time. Stacks a climbing penalty on the tool itself. Combine books with books first, apply once.
- Chasing a treasure-only enchantment at the table.
Mending,Frost Walker, the two curses,Soul Speed,Swift Sneak, andWind Burstnever appear there, period. - Renaming last. One more anvil trip on an already-expensive tool can push it past the 39-level cap. Name early or on a cheap item in the bracket.
- Forgetting lapis, or forgetting the grindstone can reset a penalty that has climbed too high to keep enchanting economically.
FAQ
How many bookshelves do I need for level 30?
Exactly 15, placed with a 1-block gap (air or a replaceable block like grass) from the table, on two height levels: the table's level and one block above it. More than 15 does nothing.
Why does my table cap below level 30 even with 15 shelves built?
Check for any normal block sitting in the one-block gap between a shelf and the table, including a torch. Almost anything that isn't air or a replaceable block breaks that shelf's connection, even though it visually looks close enough.
Why does my anvil say "Too Expensive"?
The combined operation cost exceeded 39 levels, usually from applying enchantments one at a time instead of combining books together first. Each anvil trip roughly doubles the penalty on that item (1, 3, 7, 15, 31 added levels). Combine books into one big book first, then apply it to the tool in a single step.
Does the order I combine items in actually matter?
Yes, significantly. The wiki's own worked example shows the same two items costing 2 levels combined one way and 12 levels the other way, because the penalty follows whichever item went through the anvil more times. Always merge cheap items (books) first and touch the tool only on the final step.
Can I get Mending from the enchanting table?
No. Mending is a treasure enchantment along with Frost Walker, Curse of Binding, Curse of Vanishing, Soul Speed, Swift Sneak, and Wind Burst, none of which ever appear as table offers. Mending and Frost Walker can be bought from librarians; the other three cannot even be bought from librarians and require bartering, fishing, or structure loot.
Does putting more than 15 bookshelves help?
No. 15 is the cap for the maximum enchant level. Extra shelves are purely decorative.
What does the grindstone do to the prior-work penalty?
Grinding an item removes its enchantments (curses excepted) and resets its accumulated prior-work penalty to zero, while keeping any custom name. Reach for it when an item's penalty has climbed too high to keep enchanting economically.
Why are my table enchants random?
The table intentionally hides and randomizes results. Use librarians when you need a specific enchantment rather than gambling. With your gear enchanted, natural next steps are brewing potions to buff yourself for fights and the Nether, and building a beacon for permanent haste while you gather materials.
Updated for Minecraft 26.2 on September 11, 2026, with exact anvil prior-work penalty numbers, the treasure enchantment list, and grindstone behavior verified against minecraft.wiki. Bookshelf geometry and the level-30 requirement are re-checked each version.








