Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Creators
Details

Over-engineered librarian trade finder for fabric
A highly configurable fabric mod to automatically cycle a librarian villager for the desired enchantment by replacing his lectern
Features
- Stops the process, when an enchantment from the goals list is found
- All the configs and the goals list gets saved to a file, so you don't have to set up the mod every time
- Stops when you are too far from the villager.
- Stops when villager accidentally picks another job during the process.
- Checks if villager was already traded
- Stable against multiple lag types
- Checks if enchantment can be obtained from a villager and complains if not
- Supports enchantments tags up from
1.19.3 - Single JAR for all Minecraft versions from
1.17up to1.21.11
Installation
You can download the mod on the releases page on GitHub or from the Modrinth page
Build
You can also build the project yourself.
For this just clone the repository and run ./gradlew build.
Note, that you'll need Node.js installed on your system.
The compiled mod jar can be found under build/libs/.
Usage
Enchantments in the goals list
- Add enchantments to the goals list through
/librget add <desired enchantment> [desired level] [maximum price in emeralds], where the desired level parameter is optional and defaults to the max level and price parameter is optional and defaults to 64 - The goals may be removed through
/librget remove <enchantment> <level>or fully cleared using/librget clear - To list all added enchantments use
/librget list. The output will contain a(remove)button after each enchantment, which can be clicked to remove the item from the list.
Customization
Levels
Datapacks/Mods may modify villagers to trade with higher levels of
enchantments than what is set in vanilla. You may enter any value in the level argument
to add an enchantment with a greater level to the goals list.
Enchantments
By default, LibrGetter only parses enchantments available on the client. If you play on a sever, the list of enchantments may be modified through a server-side plugin to which the client has no access to.
LibrGetter add command has an edge case where you can add custom enchantments in the form
of a minecraft id. To use this feature, your enchantment has to be put in double quotes like
"enchantmentsolution:sand_veil". Note, that when adding a custom enchantment to the goals list,
the level argument is required too, since the highest level is unknown.
You can read more about plugins compatibility further below
Warning
Adding custom enchantments or levels exceeding the vanilla maximum sends a warning into the chat by default.
This warning also covers non-tradable enchantments. You can enable/disable all the warnings with the config option warning.
Start
Automatic
/librget auto automatically selects the closest lectern in a 4 blocks radius and the librarian closest to the lectern,
and starts the process. If you stand close to two or more villagers and lecterns, LibrGetter might select the wrong targets.
Manual
- Face a librarian and type
/librget(client-side command) - Face his lectern and type
/librgetonce again - You can then start by running
/librget start
Stop
Stopping a process is as simple as writing /librget stop.
To continue the process after stopping, the recommended way is to use /librget continue,
which works the same way as /librget start, but will not reset the counter.
Restarting with /librget auto will not keep the counter as well.
Config
Process
/librget config autoTool <true/false>- enable/disable automatic tool selection (default:true)- When true: each time before breaking the lectern mod chooses most efficient tool, which has more than 10 durability points
- When false: mod remembers which tool you are holding when starting the process and switches to exactly this tool each time before breaking If holding nothing or a non-tool item, no tool will be picked
- This config has no effect when manual mode is enabled
/librget config offhand <true/false>- enable/disable putting the lectern in the offhand for higher efficiency (default:false)- The process becomes a bit more efficient if you don't have to switch slots in order to place the lectern
- Note: you will need to have more than one lectern in your inventory in order to increase efficiency
- Note: you can also place the lectern in the offhand without the
offhandconfig and it will remain there - This config has no effect when manual mode is enabled
/librget config manual <true/false>- enable/disable manual mode (default:false)- Manual mode disables the automatic breaking and replacing of lecterns as well as trade locking and clicking the librarian for you, and gives you more control about the functionality
- Even though automatic clicking is disabled, you will only have to click the villager but the trades will be automatically parsed and the merchant screen will be automatically closed
- When enabled, upon finding an enchantment from the goals list, the mod will switch to a state, where you can not break any lecterns
To finish the process you will have to use
/librget stop
/librget config waitLose <true/false>- enable/disable waiting for villager to lose profession (default:false)- Villagers will usually update the profession, when the lectern is replaced Although, in some situations, server-side lag may be so high, that this doesn't happen If you experience lags, this option is recommended to turn on
- The waiting mode will slow down the process by around 1-2 ticks without lag, but will guarantee, that the villager updates its profession
- When manual mode is enabled, during this waiting the placing of the lectern is disabled on the client
/librget config safeChecker <true/false>- enable/disable the safe checker (default:true)- Checks if the villager could interfere with the placing process by running over the lecterns position
- If the villager is inside a vehicle, the test if positive by default
/librget config timeout <int [0; 20]>- Time in seconds to wait for a villager to update its profession before replacing the lectern- If set to
0, this option is disabled (default) - If set to any other number, the mod will hang in a state, where it waits for the villager to accept the librarian profession for the specified amount of time in seconds, until it reaches the timeout, then it will break and replace the lectern again
- When manual mode is enabled, the lectern is to be replaced manually
- If set to
/librget config rotationMode <NONE/INSTANT/SMOOTH>- How to change head rotation between breaking the lectern and talking to the villager (default:INSTANT)NONE- don't change head rotation; may trigger AntiCheatsINSTANT- rotate the head instantly; should bypass most simple AntiCheatsSMOOTH- imitate natural player head rotation; slows down the process drastically but should bypass even some advanced AntiCheats- This config has no effect when manual mode is enabled
Actions on success
/librget config notify <true/false>- enable/disable sound notification when finding an enchantment (default:false)/librget config lock <true/false>- enable/disable locking the trades after match (default:false)- In order to lock a trade you will need to have one of the following inventory configurations:
- 24 paper to sell and 9 emeralds to buy a bookshelf
- 1 book and an amount of emeralds equaling to the most expensive expected book
- This config has no effect when manual mode is enabled
- In order to lock a trade you will need to have one of the following inventory configurations:
/librget config removeGoal <true/false>- enable/disable removing the goal from goals list when being found (default:false)- When false: when an enchantment is found, the
(remove)-button will appear in the message
- When false: when an enchantment is found, the
Messages
/librget config logMode <NONE/CHAT/ACTIONBAR>- where to log found enchantments (default:CHAT)NONE- don't log anywhereCHAT- log in the client chatACTIONBAR- log into the action bar
/librget config checkUpdate <true/false>- enable/disable checking if a new update has been released (default:true)- An update message will appear in the chat once on the first world/server join. If you have Mod Menu, it will show you a blue dot whenever a new version is available, regardless of this config
/librget config warning <true/false>- enable/disable warning when custom enchantments format is used (default:true)
Goal matching
/librget config fallback <true/false>- Fallback option to search for unsupported enchantments (default:false)- Takes all the data given about trades from the villager, convert it to text and search for all enchantment IDs currently in the goals list
- It is not guaranteed to make a match, and can cause false positives
- May cause lag with a large list of enchantments
- Use only as a temporary solution, if the plugin you are playing with is not supported
/librget config matchMode <VANILLA/PERFECT/NUMBER>- When to stop cycling (default:VANILLA)VANILLA- the first or the second trade matches the goals listPERFECT- all offered trades match the goals listATLEAST- at least N trades must match the goals list, N is given bymatchAtLeast
/librget config matchAtLeast <int [1; inf)>- Number of unique trades which must match the goals list to consider the attempt a success- If
matchAtLeastis greater than the amount of items in the goals list, LibrGetter will use that amount instead. - Note: the search time is expected to grow exponentially with increase of this config
- If
Match Mode
While VANILLA is pretty intuitive, the other two Match Modes may be a bit confusing.
You'd use PERFECT, whenever you want to get a perfect villager without any wasted trade offers.
You'd use ATLEAST, whenever you want to effectively find some enchantments from your goals list, while tolerating wasted trade offers.
Some example scenarios:
- You'd like to get a villager with any matching offer.
Then you'd use
matchMode ATLEASTandmatchAtLeast 1 - You'd like to get a villager with his offers ideally covering the whole goals list at once.
Then you'd use
matchMode ATLEASTandmatchAtLeast NwhereNis the amount of items in your goals list
Compatibility Config
This list of configs enables/disables compatibility with different client-side mods, possibly modifying the process of finding an enchantment. All compatibility configs are disabled by default. Compatibility configs are grayed out when the corresponding mod is not installed. You can read more about what each mod changes
/librget config tradeCycling <true/false>- Trade Cycling integration
View Config
You can use /librget config <config> to print out the currently set value.
In addition to that you can modify the config file manually. The file is located at <minecraft folder>/config/librgetter.json
Config Menu
LibrGetter provides a keybind to open a book GUI with clickable configs and their short description. By default, the keybind is set to the letter K. The menu provides an overview of all togglable configs and grays out configs which have no effect with the current setup.
Compatibility with Other Mods
Client Side Mods
LibrGetter tries to be compatible with all other mods, by modifying the client as little as possible.
Mods that previously were not compatible and were made explicitly compatible:
- OffersHUD (Modrinth)
Mods that add/change functionality of LibrGetter:
Trade Cycling
With Trade Cycling (Modrinth) installed on both the server and the client, instead of replacing the lectern, LibrGetter will push the cycling button, until an enchantment is found. Since Trade Cycling requires you to have the Merchant screen open, the process can't be stopped using commands, instead you can close the trading screen to automatically stop.
Visible Traders
With Visible Traders (Modrinth) or any similar mod,
it is now possible to customize the search even further by adjusting the matchMode config.
Plugins
In a previous update, a system with fallback for dynamic plugin support was developed allowing me to explicitly add support for new plugins.
The finding of enchantments goes through following steps:
- Goes over every plugin added explicitly in LibrGetter (see below) and searches for plugin specific enchantments.
- Tries to find a vanilla enchantment.
- (optionally) Takes all the data available on the villager and searches for the enchantment string.
Explicitly added plugins:
- Enchantment Solution (SpigotMC)
Plugins, that are known to be compatible without further adjustments:
- ExcellentEnchants (Modrinth)
You can request support for more plugins in the issues.
If possible, please provide the whole output of the /data get entity <villager> command,
where villager is a librarian selling at least one custom enchantment provided by the plugin.
Localization
LibrGetter supports localization and currently implements the following languages:
- English 🇺🇸/🇬🇧
- German 🇩🇪
- Russian 🇷🇺
- Vitenamese 🇻🇳 (thanks @ToanAnh312)
- Japanese 🇯🇵 (thanks @H1ggsK)
- Spanish 🇪🇸
You may request further languages or suggest improvements in the issues or the Discord Community.
About Me
I am a computer science student in Germany and have a part-time job at a tech company. Apart from that, I enjoy my free time by spending it with friends, chatting online or gaming.
If you want to keep this project alive, found it helpful or just want to support and motivate me to go on, you could consider making a small ☕ donation.



