mistrk7 / librarians-balance

A datapack to balance Librarians
Other
0 stars 1 forks source link

Librarian's Balance

Librarian's Balance is a Minecraft datapack that integrates custom trading into vanilla, applies a couple of tweaks to loot tables, and runs functions that tweak the trading system. This description will describe most of the features in this datapack in some detail.

Visual overview of the core concept to balance Librarians

Trade cycle

Customisable Trades

Enchanted books are placeable on lecterns. Librarians adapt their enchanted book trade to what's on their lectern. The emerald price gets updated based on two parameters from that book; the best enchantment & the number of enchantments. A simple explanation is below. The logic was written in Python before I ported it over to mcfunction.

(spoilers, maybe??)

Price of enchantment = price(best enchantment) * number of enchantments

Treasure Enchantments & Sealed Books

With custom trades the uniqueness of enchantments could get lost because anybody could take a copy from their friend and produce as many more as they want. The 'sealed' books system prevents this by nerfing duplicated books, making them unable to be placed on lecterns, so their exclusive purpose is to apply on gear.

Sealed books are designed to keep enchantments valuable throughout a server economy. If a master enchantment book produces sealed variants, it's up to the player how they want to distribute it.

Enchanted books that get sealed fit the description of 'treasure enchantments', which in Minecraft are what you can't get through villagers, not obtainable on an enchantment table, but that you can find as loot in the world. The definition has changed a little bit now but that doesn't matter because to me these are books that are uniquely obtained and exclusive to the players who get them.

Books that are affected by the 'sealed' books system once traded are the following:

One notable exception is Mending. We had Mending as a sealed variant at one point, but because of how necessary it is to the core game and how difficult the datapack makes obtaining it (will talk about this later), it was voted against.

Tweaks to Villager Trades

Librarian's Balance makes tweaks to trading to better support the custom trade system and the progression of obtaining enchantments through villagers.

The function that runs these filters happens on every villager every time one is right clicked.

Configuration

Run:

/function libal:config

image

Alternatively, edit settings.mcfunction in the folder data > libal > functions (datapack only). You can view and configure 'sealed books' from here.

Links

Modrinth

Discord server