Community listing page, reviews may not be monitored by the author.
Stackable Enchanted Books
No reviews yet
Identical enchanted books stack up to 16 (configurable 1-64) instead of 1. Anvil and grindstone still work one book at a time, so nothing is duplicated or lost. Fabric 1.21.1, needs Fabric API. Install client and server with the same config.
Community voices
Reviews
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
Stackable Enchanted Books
A small Fabric mod for Minecraft 1.21.1. Identical enchanted books stack up to 16 instead of 1 — you can raise or lower that limit in the config.
Enchanted books that are actually identical (same enchantments, same levels, same anvil work penalty, same custom name, same everything else) pile up in your inventory and shulker boxes like any other item. Books that differ in any way still take separate slots, exactly like vanilla.
Features
- Identical enchanted books stack, up to a configurable limit (default 16).
- The anvil and the grindstone are updated to work on one book of a stack at a time, so a stack is never duplicated or destroyed in a single operation.
- No other item is affected. Only enchanted books get the new stacking behavior.
- No registry changes, no new items, no new blocks — just a default item component tweak plus the container fixes needed to keep it safe.
What counts as "identical"
Two enchanted books stack together only when the game itself considers them
the exact same item: ItemStack.isSameItemSameComponents. In practice that
means the same stored enchantments at the same levels, the same anvil repair
cost, the same custom name, and any other component matching. A Sharpness I
book will never stack with a Sharpness II book or with an Unbreaking I
book. The mod doesn't add any merging logic beyond what vanilla already
checks for "is this the same item".
Anvil and grindstone behavior
Vanilla assumes every enchanted book has a count of 1. Without extra care, letting books stack would mean losing whole stacks to a single anvil pull or duplicating them in creative mode. This mod changes the relevant vanilla code paths so stacks are always handled one book at a time:
| Situation | Result |
|---|---|
| Anvil, book stack in the right slot (e.g. sword + 16 books) | exactly 1 book is used per operation, not the whole stack |
| Anvil, book stack in the left slot with something to combine on the right | worked one book at a time, at the normal single-book XP cost; taking the result removes 1 book from each stack, and a shift-click takes only one result |
| Anvil, book stack in the left slot, right slot empty (renaming) | unchanged — the whole stack is renamed and returned together, same as renaming any other item stack |
| Grindstone, a single book stack with the other slot empty | 1 disenchanted book at a time; a shift-click grinds the stack one book at a time, each for that one book's XP |
| Grindstone, book stack next to another item | no result, same as vanilla |
| Grindstone, two identical single books | vanilla's normal stackable-item path: 2 books in, 2 plain books out |
Everything else that touches books — the enchanting table (single-item slot, and enchanted books can't be enchanted anyway), the chiseled bookshelf, lecterns, loot tables, and villager trades — already worked correctly with stackable books and needed no changes.
Configuration
The mod creates config/stackable_enchanted_books.json on first launch:
{
"maxStackSize": 16
}
| Key | Default | Valid values |
|---|---|---|
maxStackSize |
16 |
whole numbers 1–64 (1 keeps vanilla behavior) |
- The file is read once on startup — restart the game or server after changing it.
- An invalid value (bad JSON, wrong type, a fraction, NaN, or out of range)
logs one warning and falls back to
16. The mod never rewrites or "fixes" your file for you. - On every start, the mod logs one line stating the value in effect, e.g.
Enchanted books stack up to 16.
Requirements
- Minecraft 1.21.1
- Fabric Loader 0.16.0 or newer
- Fabric API
- Java 21
Install on both sides, with the same value
This mod changes a default item component, which isn't something the
network syncs between client and server. Install it on the server and on
every client, using the same maxStackSize.
If a client and server end up mismatched anyway (nothing prevents it — the mod adds no registry entries or packets to check for), here's what actually happens, verified against the 1.21.1 source:
- Survival/adventure inventories and containers: the server is authoritative and sends back the correct slot contents, so at worst you'll see a visual glitch — books that seem to merge and then snap back, or an anvil/grindstone preview that's briefly wrong. Nothing is duplicated or lost.
- Creative mode: the server rejects a creative slot update above its configured limit, so a client with a higher limit can see a picked-up stack vanish. This is specific to creative inventory handling.
- Uninstalling later: worlds still load fine. Vanilla itself accepts saved stacks above an item's normal limit (up to 99), so existing book stacks just sit as they are until you move or split them.
Compatibility and limitations
- The mod is built on four small, targeted mixins (into
AnvilMenu,GrindstoneMenu, the grindstone result slot, and one hook inAbstractContainerMenu.broadcastChanges) plus Fabric API'sDefaultItemComponentEvents. - Mods that replace vanilla's anvil or grindstone logic outright (anvil overhauls, "no too expensive" mods, custom grindstone implementations) or that add their own separate book-consuming machines are not covered by these mixins.
- This is intentional: if another mod overwrites the exact vanilla methods this mod hooks into, Mixin will fail loudly and stop the game at startup, rather than silently letting a dupe or item-loss bug slip through.
- Enchanted books in a bundle (experimental in 1.21.1) now take up 1/16 of the bundle each instead of filling the whole bundle.
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
(opens in a new tab)
Get it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources