Data Packs Game Mechanic

Librarian's Balance

  • 22.7k views • 6 today
  • save_alt 1.9k downloads
Compatibility
Minecraft 1.21
to version
Minecraft 26.2
Changes include
  • Functions
  • Loot Tables
  • Predicates
Added Creditgibbsly
  • 76
  • 74
  • 44
Misterk7_-
Lvl 66 • High Grandmaster Peacock Sniffer
112

The issue...


Librarians in Minecraft are tedious and unbalanced. It's too easy to obtain powerful enchantments that should reflect your dedication to the game. And rerolling trades is not a fun or engaging way to obtain them at all.

I thought this part of Minecraft really needed a rebalance, so this is what I came up with.

Introducing: Librarian's Balance

  1. It allows you to buy copies of any enchantment book you own through a librarian.
  2. Villagers provide books of Level 3 and below, which can only be bypassed by the first mechanic & anvil upgrades.
  3. Mending becomes a treasure enchantment and you can only find it in End or Ancient Cities, so you need to use the first mechanic to trade for more.
A breakdown of this datapack in more detail is below...

Featuring...

1. Customisable Trades: Place an Enchanted Book on a Librarian's Lectern, and their first or second book trade will change to the one you entered. This gives new purpose to the books you collect in the world. Some books are treasure enchantments and these will produce untradable (sealed) variants when bought from a Librarian in this way.

2. Limit Random Trades: Librarian enchanted book trades are only random up to Level 3 by default. To obtain a Level 4 or 5 trade, you need at least one book of the enchantment type of your choice. Then buy another using the custom trade mechanic, combine them in an anvil to increment its level, and repeat.

3. Rare Mending: Librarians do not trade for Mending so players will have to find it in the world. Once obtained, you can put it on a Librarain's Lectern to trade for more. It can be found in End Cities or Ancient Cities common as an armour trim.

Everything listed here can be toggled or configured with the [ /function libal:config] command (must be run as an OP). It also changes loot tables, so if you don't want that delete the 'loot_table' folder inside the pack. This datapack works great to enhance the Villager Rebalance experimental feature from Mojang! (not required)

Uses


On Survival Multiplayer servers you may find enchantment progression too quick by some members of the server. Librarian's Balance provides a balanced progression system by use of experience points, emeralds, and requiring a proper level of exploration.

Feedback:

Please give feedback on the GitHub page or on my Discord server! I'm interested in hearing your ideas, opinions or suggestions from your time with this datapack. What do you think about the sealed books system? Do you think that the book pricing is appropriate?

Notes:

You might see the UI show a mending or >3 enchantment sometimes, but it's just a visual hitch and you should ignore it. Any mod that re-rolls trades besides reopening the Villager GUI will not filter their trades. This is my first datapack, so I'd appreciate any feedback or contributions.

If you're playing modded and are having issues, try running [ /function libal:load ].

I built this datapack upon parts of gibbsly's Lectern Enchanting. I want to thank him for providing a starting point for this project, and for some of his tutorials on YouTube. Otherwise I would have had no idea on where to start making something like this :).

Configuration


To configure Librarian's Balance in-game run as an OP:
/function libal:config
Alternatively, edit [ ​settings.mcfunction ] in the folder [ data > libal > functions ] (datapack only).

--

This project is on Modrinth and is open-source.

23 Update Logs

Update #4.0 - Backporting Time : by Misterk7_- 09/18/2026 4:46:08 pmSeptember 18 @ 8:46 pm UTC

  • Restored functionality for the last two slots in custom enchant config
  • Added broader compatibility for modded enchantments when filtering
  • (26.3) Fixed bug of enchantments not instantly updating in the UI (Mojang)
I'm marking this release as 4.0 because I'm going to start backporting this data pack down to at least 1.21.6. At time of release it's available for 26.2 and 26.3 I'm very happy with it now! The stretch goal is to 1.21.1 .
LOAD MORE LOGS

More like this

  Have something to say?

Ocaspian
• 05/01/2026 4:23 am
• Level 1 : New Miner
Does anyone know how to use the detailed mode? I have villagers with patches, but when I apply the data pack they disappear, and enchantments like sharpness 5 become sharpness 3. Can anyone help me solve this?
1
wumster likes sniffers
• 04/15/2026 5:07 pm
He/Him • Level 38 : Artisan Pig Carrot
kewl
2
Notoriousi
• 03/20/2026 4:40 pm
• Level 1 : New Collective
Would be cool to edit the prices. Like make it more expensive or even price per level of book. Modded servers/clients could have levers higher than 5 too so would be nice if it would be considered by the datapack. Right now anything above 5 shows up as the base price of 7 emeralds
2
Misterk7_-
• 04/13/2026 4:19 pm
• Level 66 : High Grandmaster Peacock Sniffer
Please test out the latest version
1
Misterk7_-
• 03/26/2026 12:46 pm
• Level 66 : High Grandmaster Peacock Sniffer
Thanks for the suggestion, I will look into this for the next update. I technically already had this sort of logic jotted down in my python calculator tool but it wasn't implemented into the pack itself. Basically every level >5 will cost (the book level - 1) * 12 , so Lvl6 = 60 emeralds, Lvl7 = 72 emeralds, and so on. Let me know how you feel about that logic.
1
Notoriousi
• 05/31/2026 2:22 pm
• Level 1 : New Collective
I think tha'ts pretty fair pricing. Although you might run into issues where a certain very high level book with many higher than vanilla enchants could end up costing more than 64 emerald blocks. I'm not sure that limit would be reached quickly lol, just something to consider! But yeah that logic would be cool! and perhaps make it an editable value so you can choose the multiplier to be 16 or like just 10 or whatever. Give the player some freedom :)
1
SkylimitPanda
• 08/01/2025 5:59 pm
• Level 35 : Artisan Cat Sweetheart
Sometimes when I place a book in a lectern the villager doesn't switch trade to the one I placed and plays a "disgruntled" particle. I'm not sure but I think this only happens when the villager initally doesn't have a book trade in the first two trades. Is this how it works and is this intentional?
1
Misterk7_-
• 08/09/2025 4:53 pm
• Level 66 : High Grandmaster Peacock Sniffer
This is intentional. Although not ideal it was a limitation with how it was implemented at the time. I may revisit this issue in the future
1
Nikinikie
• 07/26/2025 1:21 pm
• Level 1 : New Miner
history
Has a very obvious bug in 1.21.8 where right-clicking on an empty lectern with an item after removing an enchanted book will just give you a copy of said book. Indefinetley. Didn't test on other versions
1
Misterk7_-
• 08/09/2025 4:53 pm
• Level 66 : High Grandmaster Peacock Sniffer
Sorry about that. It's been fixed now.
2

Welcome