Rebalance Villagers
» If you like this plugin you should definitely check out our other plugins too «
Rebalance Villagers
This plugin allows you to configure a detailed collection of game mechanics pertaining to villagers. Its most notable feature is complete control over the offers which can be generated - by default, it also starts with an extensively reworked set of prices to make trading dramatically less abusable while still allowing it to be profitable (more on that later).
This plugin's default settings may be enough to repair the currently exploitable villager trading system - however, in case you want your own server to have a few special touches, so trading can be balanced perfectly for it, this plugin allows you to adjust the following:
In config.yml, you'll find general settings:
- Control over offer removal: You can choose how many times an offer can be traded before being removed, how long it takes for offers to be removed, or simply disable offer removal altogether.
- Control over offer generation: You can choose how many offers a villager starts with, how many offers are generated at once, how long it takes for offers to be generated, whether villagers generate offers after any trade, and what the chance of offer generation is.
- General trading settings: You can control how long the decorative particle effect lasts when villagers add/remove offers, choose whether players can trade with villager children, and choose whether players can squabble over villagers by letting them kick each other out of the trading window.
- General settings about villagers themselves: You can specify their max health, make them invulnerable to all harm, and choose which villager professions can spawn naturally.
- There are also some technical settings related to using this plugin with Shopkeepers, but once full compatibility between Shopkeepers and this plugin are established, these will be removed (these settings don't do anything magical; you won't miss them).
In offers.yml, you'll find settings to control the offers villagers can make:
- You can define your primary currency item, which will be used by all non-custom offers you include - it can also be used in your custom offers, for convenience.
- You can define all of the offers which can be generated by each villager profession, and the offers which get generated by default.
- You can define offers for your own custom villager professions (which can be spawned with world editors, or by editing config.yml to allow them to spawn naturally). The number of custom professions is virtually unlimited (unless you want more than 4 billion), but they all appear identical to the unused green villager.
- You can remove existing offers or make them never generate.
- You can define offers as 'buys', or 'sells', to use an existing table of prices, or 'other' to create custom offers.
- Custom offers give you full control of the two input slots and output slot, allowing for offers which don't use the currency item, offers which provide random or specific enchantments, offers with any damage value on any item or block, and almost any type of offer a world/NBT editor could create (the only thing you can't do is have offers which provide books containing specific text). Note that item quantities and enchantment levels can be randomized, too!
- You can control the values in the tables of prices, used by non-custom offers.
All of these features are explained in detail in the config files. In fact, offers.yml has a sort of "tutorial" on how to edit it.
By default, this plugin...
By default, this plugin disables the vanilla system of offer removal, and changes the offers which villagers can generate.
No offers are added or removed, and the chances of offers are also the same as they are in vanilla Minecraft. However, pricing has been extensively reworked, based on my work in this thread. Basically, I have created a chart which carefully balances the values of items based on many criteria, geared at producing a far more sensible and less exploitable set of prices than the vanilla system.
The reason my plugin disables the offer removal system by default is because, aside from many players' complaints, this thread explains why the system makes trading unusable without exploitation. Just as my defaults are intended to reduce the potential for exploitation, they are intended to reduce the need for exploitation.
If you wish to start with vanilla Minecraft settings, simply copy the contents of "offers-vanilla.yml" into offers.yml, and see the top of config.yml for vanilla defaults on offer removal.
Other Features/Conveniences
First, alongside the detailed explanations in config.yml and offers.yml, you'll be happy to know my plugin has a load of failsafes packed in. If you configure it incorrectly, the plugin will not crash (unless you make the config files unreadable!). Instead, it will choose some value which allows it to safely run (for example, if you specified a number as 0 when the lowest accepted value is 1, the plugin will use 1 instead). Now, you may be thinking that's a bad thing, but the plugin will let you know when this happens:
Warnings will only appear when you've done something incorrectly in the config - otherwise, normally the console doesn't get spammed ;)
Also, if you leave a value out of the configuration, the plugin will usually revert to a default - but don't make a habit out of this :p
The vanilla generation system doesn't allow you to earn more than one emerald from selling an item, unless you manually specify a custom offer - despite being able to specify offers which *give* more than one item in exchange for one emerald. My plugin fixes this, making the buy and sell values tables formatted the same way. Thus, it's easy to make offers like this one:
Probably my most convenient features in this plugin are Smart Stacking and Smart Compression. Let's say you want a villager to sell a diamond helmet for 98 emeralds. A player can't place more than 64 emeralds in one slot, and Smart Stacking realizes that. Smart Stacking will automatically do this for you:
Smart Stacking basically makes 128 the maximum amount of an item a villager can accept (warning: Smart Stacking is currently not smart enough to realize certain items do not stack or stack only up to 16. For this, I'm afraid you'll need to make a custom offer, but that's not difficult).
Sometimes you need a villager to take more than 128 of an item, and that's when Smart Compression comes in. Here's how an offer requesting 129 emeralds is handled:
If you were to convert those emerald blocks into emeralds and add the rest of the emeralds to it, you would see the total is indeed 129. Smart Compression effectively increases your maximum up to 640: a stack of the compressed item, and a stack of the uncompressed item. Also, Smart Compression works on emeralds, diamonds, gold ingots, gold nuggets, and iron ingots, all of which can easily be converted into a compressed form at a ratio of 9-per-compressed-item and likewise converted back - thus, you can set your currency item to any of those items and rest assured that Smart Compression will still apply.
Using My Chart to Balance Trading Yourself and Exporting the Results to Your Configuration
I suppose this is also a convenience/feature, but it deserves its own section. Remember that chart I mentioned earlier? It can be downloaded here, and is fully interactive.
The only cell in the chart with a value not calculated from other cells is the gold-colored cell next to Gold Ore. It's a sort of "gold standard", if you will, which determines how much emeralds are worth. Double it, and emeralds are halved in value. Halve it, and emeralds are doubled in value, and so on. The rest of the chart will update with your changes.
If you don't want to use emerald as your currency item, you can choose an item you do want to use. If it's in the chart, find its value in the "Adjusted for Usefulness" column. This column is bold because it represents the actual worth of that item in emeralds. Now, take that number and invert it, and place that inversion in the golden cell (so, to set the currency to diamond, you would put 1/17.7999 into the gold cell). If you did this correctly, the "Adjusted for Usefulness" of that item should read 1, as it is indeed worth one of itself. All other cells in the chart have been recalculated in value, and are now priced in that item instead of emeralds.
You can make any other changes to the chart by editing the formulas of its cells, or editing the special variables to the right of the chart (the "Modifiers" column, U).
Finally, look for "Rebalance Villagers Plugin", cell AC1. Around there, there are four cells (in the "Copy this code into offers.yml" column) which you must copy the contents of into offers.yml. The proper destinations of each are specified in AC, while the actual values to copy are in AD. Simply copy these in, erasing the unwanted original values in the process, and the plugin will new use these values.
Note: If the cell AF6 says there are errors, please look in the column V ("Valid Offer Checker") for what the errors are. These errors are when invalid offers are created, for example offers which are impossible to complete (requesting more items than the player can put in the input slots), offers which would produce impossible item stacks (e.g. stacked tools), or nonsensical situations such as a villager providing items at a cost of zero emeralds. So remember to make sure there are no errors reported in AF6 before you copy the config outputs!
Oh, and if you changed the currency item in the chart, be sure you change 'currency-item' in offers.yml too!
Dev Builds
You can always find the latest snapshot in the Jenkins.¹
Github Source Code
The source code of this plugin can be found here. It's my first plugin, so feel free to let me know if I've done anything horribly nooby :p
If you would like to contribute to the plugin, you may use Pull Requests. Add yourself with an '@author' in the javadoc tags of any part you create or substantially modify - you can identify yourself with whatever name you like. Of course, I will publicly acknowledge that you have contributed to this project.
Special Thanks
- WolfieMario, the initial creator of this plugin: thanks for the whole idea and opportunity with this great plugin and thanks for all your work you've done here!
- nisovin, the creator of the Shopkeepers plugin: thanks to him/her making Shopkeepers open-source, WolfieMario could make the plugin compatible with his and rest assured that he's not doing anything horribly wrong in the code.
- Icyene, for pointing WolfieMario in the right direction when he started - without his good deal of help, he would have had no clue how to start coding this plugin.
¹ Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
· · ·
» Powered by Cube Nation «
@bratpitt
Changing the CookedFish to '350' worked. Thank you.
Hi, I downloaded RebalanceVillagers 1.7.4 , and server version is bukkit-1.7.2-R0.2 Beta.
I found my villagers can't generate offers correctly.
first, I have set that default-offer-count: 2, but villagers always generate 1 offer when they spawn.
second, villagers always generate 1st and 2nd offers set which are writen in offer.yml, never generate other offers.
Well, I would like to see this working. but http://gyazo.com/6fb59b6cd0ac46e11cc2830255805fda I have tried everything pelase help Thanks!
I must really thank you for this plugin. The documentation is the best of any plugin I've ever used, and that really makes a difference!
Keep up the good work, and thanks for taking the time to actually document well!
@der_Kernschatten
Had it also, I guess they changed name after they added more fish types. Change both CookedFish to '350' in offers.yml will solve it.
CubeNation: I'm getting 'fishCooked' warnings that did not exist before and I'm using the defaults.
Love this plugin..
I have noticed iron golem suddenly get aggressive without i done something to upset them, not sure if this is related to this plugin or not, trying too isolate the problem, do someone else experience same thing? EDIT: Solved i think, had to do with my popularity!
Another thing is about villagers, i like too have the possibility that they might get killed but i feel it shouldn't be easy. Raising health is one way to go but they are still passive and there for still easy. Would like to see possibility that they fight back when attacked.
Thanks again for great work, a donate is on its way :)
For anyone who is curious, I realized after my last post that you CAN indeed switch the currency in the config, and configure different traders for different prices, and the Villagers will remember what you set the price for (regardless of which currency you use)
One last question; I noticed that my players can only trade with a villager so many times, before there is a red X displayed and they cannot trade anymore...is there a way to disable this? I did I miss something in the config?
Thanks again for the great plugin, I really enjoy it!
Great plugin! 1 question, could you add the ability do gold nugget - gold block compression? This would allow us to buy/items for a wider price range.
Here's how this feature would help my case;
Originally (other shop plugins before I found this) I had it set so you could sell 4 stacks of cobblestone (264 blocks) for 1 gold ingot this amount is not supported from my understanding (because the plugin does not support more than 2 stacks of an item). The solution would be to change my currency so that I could equal it out (4 nuggets for 128 cobble) but there is one problem with that....
I have it set so that a Diamond Chestplate costs 400 gold ingots (which would REALLY throw balance off because of the way I have my game configured) so I would not be able to use that because the max it would be able to make my villagers accept would be 64 ingots + 64 nuggets, right?
So what I am essentially requesting is a way for the plugin to first convert nugs into ingots, and then ingots into blocks.
In theory, it would allow you to sell something for 1 nugget, or sell something for 5,248 nuggets (which would be 1 stack of Gold Blocks in the first column, and 1 stack of nuggets in the second) OR 10,368 (if you could somehow manage to allow it to require 2 stacks of gold blocks to make a purchase)
It may sound like a stretch, but I really think it would really increase the possibilities for this plugin, and it is already by far the best shop plugin I can find on Bukkit that meets my needs (and is not glitchy as hell). It is also my understanding that the Gold Block is the only item that breaks down twice, so maybe you could add an exception for just gold? (so other people can still use diamonds and emeralds as currency)
Thanks again for the great work!
EDIT: One thing I could try would be to keep switching the currency/prices in the config and spawn the npc (I am basically creating shopkeepers, the trades do not change after a transaction)...Would it always for sure, remember the exact trade you set it up when you spawned the npc (and not convert currency randomly on me and break the shops)?
@ridddle
I think people should actually be looking here: http://ci.cube-nation.de/job/Rebalance%20Villagers/
To get 1.7.2 compatibility, look here: https://github.com/Cube-Nation/rebalance-villagers/commits/develop
Not compatible with 1.7.2.
@CubeNation
Thanks for coming back, CubeNation.
@CubeNation
goooooooooooooooood joooooooooooob!!
By the way, how can I get the item name list of this plugin?
Sorry for the delay. Release was just updated to 1.6.4 and is in review now.
Please upgrade to 1.6.4 i need upgrade for my server , the players are waiting =(
If you have a problem with villagers not breeding, here’s a fix. You will need to compile the plugin on your own unless @CubeNation decides to merge our pull request.
The plugin is updated but it’s not built in author’s dev Jenkins. Go to GitHub and figure out how to compile it (download Eclipse and make a Maven project then build with
clean package
). I cannot attach any jars in comments, it’s against Bukkit.org’s TOS. I compiled it 3 days ago, works like a charm.As for why it breaks… because it uses private APIs to achieve its thing. And those APIs have to be updated for every version (of Minecraft and Bukkit).
Its broken again, why does it break at every singel update?
upgrade to 1.6.4 please...