» If you like this plugin you should definitely check out our other plugins too «
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.
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!
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.
- 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 «
Awesome plugin! I started using this on my server and it was pretty cool! However I used an unmodded coal buyer and iron buyer villager, because these were way overpowered from the plugin. 4 coal per emerald and 1 iron per emerald was super op, and I felt 16 coal and 8 iron was closer to fair, or at least underpowered (which is better than overpowered for a temporary fix). I then downloaded your .ods file and messed with it for a few hours (yes, I know) until I think I got the whole thing balanced just right! :)
Check out the tweaked file here: Link Removed: http://www.mediafire.com/file/is1w30uuya1goyy/Proposed_Fix_to_Villager_Trading_-_Tweaked_by_Tristram_27.ods
In addition I then doubled the value of emeralds (by halving the value of gold ore in the orange highlighted area) and suddenly the entire server economy seems to make a lot more sense. It becomes a valid choice to simply mine emeralds, where before they were so undervalued that it would be a waste of time to mine them when u could just farm something else to sell instead. In addition, diamond gear prices are halved (due to the value of emeralds doubling) and seem much more reasonably priced than before.
Here's the file with that last tweak implemented: (I think its just perfect this way!) Link Removed: http://www.mediafire.com/file/irllyf2olady2rr/Proposed_Fix_to_Villager_Trading_-_Tweaked_by_Tristram_27.ods
I would love to implement these tweaked values on my own server with your plugin!
Here's my server if anyone wants to see the modded economy in action: EmeraldEconomy 18.104.22.168
Love the plugin. Thanks for your work on this. The default trades were game ruining.
I'd love the ability to tune individual offers, I'm looking forward to the update.
Whoops, I knew I forgot something. I figured out what the problem was, it was another plugin I had installed. I've since removed that plugin and the issue is gone :D
This is incredible. Very nice job! it must have taken a lot of work to put the values together.
I'll be implementing this plugin as soon as SpoutPlugin gets updated to 1.3.1, you're a lifesaver. Anything that stops my servers economy from being more unbalanced than it already is makes me a very happy man.
Sorry I've been absent a few days; I'm hoping to get back to this later today.
@Darkhand81 I'll be adding a config for all offers, so you can disable any trivially. Just wait for the next release!
@Joymo Sorry, currently it's out of my hands, until the Bukkit devs whip out a trading API. Otherwise, 1.4 fixes it, so you can wait for that if nothing else. It's an issue with Minecraft, not my plugin.
@diannetea Sorry I can't reproduce; can you record a video or show screenshots of the exact process?
This plugin doesn't seem to be changing any of the offer amounts based on the tables in your forum thread. Has that part been implemented yet?
Umm, so one of my players has figured out that holding down shift while trading gives the trade item without selling their stuff, is this something you can fix or do we have to hope Mojang realizes it? :(
Luckily the player is my mom and isn't telling others, but god damn is that exploitable
- I'm not trying to imply that this is caused by your plugin, I just figure since you're fixing the rest of the imbalance...
I don't get this, I have these settings:
Spawned a villager, and was able to trade his first offer unlimited amounts, ok sure, only one offer. Waited for second offer, was also able to trade that unlimited amounts. At no point did the trade get cancelled or either of the offers removed.
This really needs to be more effective to counted the extremely overpowered and imbalanced trader feature. It should not be possible to have unlimited access to any recipe.
Any ETA when the configurable version will be done? We really depend on a plugin like this to enable the villager trading on 1.3 switch. :-)
Oh god I had no idea about Shopkeepers but that's fantastic... If they worked together I'd definitely implement both
Shopkeepers in the Shopkeepers plugin are generated with a command or through villager spawn eggs... No 'enlistment' of existing villagers necessary. :)
I'm also hoping to be able to run this alongside Shopkeepers... can't wait!
One more thing... Is there any way I could stop balanced villagers from offering chainmail? Short of commenting out the lines in the method in your plugin that mention chainmail items, that is (which I suppose would work, just wondering if there's a more elegant solution).
Thanks for this plugin!
Hmm, did your shopkeepers get removed, or did they get replaced with villagers that have my prices? If it's the latter, I think I know why that happened, and should be able to fix it. In this case, you'd end up with your custom Shopkeeper villagers, and my villagers with rebalanced prices. Hopefully you'll still be able to turn rebalanced villagers into shopkeepers; this depends on how the Shopkeepers plugin was implemented.
Hello this is great! However it does not work with Shopkeepers. This will be a huge economy shop in 1.3, and it would be a good idea to implement this to work with it. Thanks for this plugin anyways though, I've tried it and it works fantastic! Just removed all of my shopkeepers unfortunately.
I was actually intending to make all offers configurable, as currently calculations are only done in my spreadsheet, not the plugin. The spreadsheet can be downloaded and edited to calculate new values, which can be put in the plugin's config once I've made offers configurable.
I'm afraid I won't include any value calculations directly inside the plugin itself, as the calculations in question are complicated and don't always yield the best results (namely, setting the gold cell to less than 0.4 causes the paper offer to require more than two stacks per emerald, which is currently an impossible-to-complete offer).
I may toy around with making the spreadsheet capable of outputting a config file for this plugin, as I suppose that will help many people.
Also, thanks for pointing that out; I'll figure out how to set up this project properly.
there's a little box at the right top corner above the "Facts" box to mange everything.
@ this plugin:
Our staff is really looking forward to see this plugin evolve in the next days/weeks, so we can extend from our current economy system to the new possibilities using the NPC tradings. Therefore we really would need to be able to change the base variable (afaik its the gold ore value) you are currently using within your calculations, so we can get best possible transition from our current price values to the emerald based economy.
Keep up the nice idea!
Sorry, how do I upload the plugin itself? I'm kinda new to this :p