Minecraft Data Packs / Game Mechanic

Librarian's Balance

  • check_circle Functions
  • check_circle Loot Tables
  • check_circle Predicates
  • 18,206 views, 20 today
  • 1,706 downloads, 0 today
  • 68
  • 64
  • 32
Misterk7_-
Level 65 : High Grandmaster uwu
108

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


Librarian's Balance is a simple datapack that solves this issue by adding a few small things.

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: Villager's Enchanted Book trades are random up to Level 3. You need to use the new custom trade mechanic to get a Level 4 or 5 trade, so first obtain this book as an item. I recommend combining two enchanted books on an Anvil to upgrade its level, or use one you found in the world.

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). This datapack works great with the Villager Rebalance experimental feature from Mojang!

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.
Creditgibbsly
CompatibilityMinecraft 1.21
Tags

16 Update Logs

Update #3.7c : by Misterk7_- 05/10/2025 4:48:43 pmMay 10th

Fixed several bugs with the original release for 1.21.5. Sorry.

- Fix 'Sealed' book text being broken
- Fix Config menu
- Book filtering now works again (ex. limiting trades to <3)

Sorry for all the bugs :p
LOAD MORE LOGS

Create an account or sign in to comment.

ScotsMiser
05/02/2025 9:19 pm
Level 61 : High Grandmaster Miner
Interesting way of achieving the end…
Not something I'd use, but superior to MS/Mj's biome based version. 👍

[On a technical note:
Does this pack do anything to treasure fishing? (Somewhat implied by the comments about Mending)
Will villagers acceopt books with multiple enchantments? and – if they do – what happens?]
2
Misterk7_-
05/03/2025 1:43 pm
Level 65 : High Grandmaster uwu
history
Nope, it doesn't affect fishing. It's based on the fact that you're unlikely to obtain Mending that way, but if you do at least you will have a renewable book to show for it! And yes villagers accept books with multiple enchants. It just recalculates the price of emeralds. The price of book = price of best enchantment * number of enchantments on book, and the price of the best enchantment goes from 7 to 48 emeralds based on its level from 1 to 5. If the result exceeds 64 emeralds, then the price is swapped with an equivalent in emerald blocks instead.

I'm interested why you wouldn't want to use this datapack? I'm biased of course XD!
3
ScotsMiser
05/03/2025 3:31 pm
Level 61 : High Grandmaster Miner
history
The reason I'm unlikely to use this pack is because it changes a mechanic [​availability (or at least means of obtaining) top level/most useful enchanted books] I don't find irksome...

Given that it would appear to allow one to set up librarians for Mending/Unbreaking3 or Efficiency5/Fortune3, however, I might reconsider when I move to 1.21.
I need to do a better analysis, but this could shift your pack from a straight nerf to a change that arguably upgrades lategame availability while lowering high end enchants in early game.

My preferred playstyle focuses on designing and building resource farms [​my current most freqeuntly played world has at least four creeper based gunpowder farms each of different design].
As an aside: it is my impresion is that it was the 1.14 changes that broke the system (5/6ths being potential librarians, and the ability to reset 1st level trades until one got something wanted).

I also have an essentially complete suite of librarians (probably not including things like power1 & 2) so any changes would effect only new worlds [​presumably].



Another question:
Do the pack villagers also accept SoulSpeed, SwiftSneak, and WindBurst? [​I would guess yes from what else they take…]
2
Misterk7_-
05/04/2025 8:36 am
Level 65 : High Grandmaster uwu
You can disable the removal of Mending from default trades via the datapacks configuration menu which should help you. For treasure enchantments (soul speed, swift sneak, wind burst etc.), villagers trade 'sealed' book variants that can’t be reused for further trading. It's designed to keep the rarity of the enchantment intact by distinguishing duplicate books from the original book, but if you're on a single player world or if you don't like that mechanic you can always disable it as well.
1
Zerohen
10/18/2024 12:45 pm
Level 2 : Apprentice Skinner
❤❤❤❤❤❤❤❤❤❤❤❤
2
Zerohen
10/18/2024 12:46 pm
Level 2 : Apprentice Skinner
Sry it won't let me have red hearts
2
Misterk7_-
11/05/2024 2:25 pm
Level 65 : High Grandmaster uwu
💖
1
Airree
08/24/2024 6:59 am
Level 1 : New Miner
history
Really nice datapack—However, could you please also blacklist Fortune from the villager trades? I have an SMP that uses diamonds as currency, and having Fortune available is kind of overpowered. I've tried modifying the datapack myself, but I’ve realized that Minecraft datapacking is not that easy, and my modified version keeps encountering errors. Thank you!
1
Misterk7_-
08/26/2024 8:09 am
Level 65 : High Grandmaster uwu
history
If you mean to strip the enchantment from appearing in trades like what Mending is doing, the best way is to modify the tags the game uses. To make it easy i've done it for you, just download and extract this file and place the folder into [ librarian's balance > data > minecraft > tags ].

Also technically blacklisting books is an entirely different system. Sorry about this process being kinda complicated, I will try to make this easier in the next versions.

Edit: I've added an extra config option for this functionality now
1
KumaYuki
08/17/2024 4:52 am
Level 17 : Journeyman Bear
does this affect mending on fishing? i cant seem to fish mending books
1

Welcome