TradeControl
Automatically control or modify the trades that are offered by villagers. This plugin is intended for server owners who want to make sure that their players cannot exploit the trading system. This way, trading can stay enabled and provide a challenging and exciting experience that is fair to everyone.
Note The exploit that this plugin attempts to fix was fixed or at least considerably nerfed in Minecraft version 1.4. TradeControl still works however, and can be used to modify villager trades.
Preamble
Villager trading as introduced with Minecraft 1.3 has a couple of widely known exploits. The result is that players are able to produce great amounts of emeralds and trade them for valuable goods, thus breaking the game. TradeControl aims at filtering the existing trades of villagers and changing them in a configurable way.
The exploit
The exploit has three components
- The possibility to trade materials that are farmable with little to no effort for emeralds. The focus is on deals including paper.
- The unlimited availability of any trade. This is possible because players can continue a single trade without limitations by leaving the trading menu open.
- The possibility to trade emeralds for goods. Minecraft offers trades for food, glowstone, diamond tools and enchantments. This breaks the game.
The solution
TradeControl can filter the available trades of existing villagers and modify the undesirable ones by either deleting them or replacing them with other ones. Both filters and replacements are configurable.
Features
- Automatically modify naturally spawned villagers in an existing world.
- Define your own trades to replace existing ones you don't like.
- Get statistics of trades that are available in your world to make sure you don't miss anything.
- Performance-savvy: Villagers are by default only checked when a player interacts with them.
Shortcomings
- There is no trading API in Bukkit, so this plugin uses the CraftBukkit and Minecraft interfaces will break with most releases.
- Enchantments are currently ignored and cannot be specified. I can add this if people are interested.
Permissions
- tradecontrol.cmd Access to the /tradecontrol (or /tc) command. This should be given to no one but admins.
- tradecontrol.notify Receive a message whenever TradeControl modifies a villager.
Command
TradeControl has one ingame command: /tradecontrol or /tc with the following subcommands:
- /tc help Display help.
- /tc reload Reload the configuration file.
- /tc scan Scan all the villagers on your server and filter their trades. This may cause one lag spike.
- /tc list Display a list of all trades TradeControl has discovered on your server since the last boot.
- /tc dump Write the list of available trades to disk for later review.
Configuration
The default configuration replaces the emerald deals for paper and written books and replaces them with a large amount of books. Trading many books for emeralds is not considered exploitable since the leather takes some effort to farm, other than the sugar cane, the process of which can be fully automated. It also makes the deals for wheat a little more expensive since wheat is fairly easy to farm.
# TradeControl configuration file # # Sections: # filters: A list of trade filters # buy: A list patterns of items the villager buys. Must be one or two. # Only matching patterns will be processed. # type: The item type as in org.bukkit.Material. # damage: The item damage or data value. # minAmount: The minimum item amount to match. # minAmount: The maximum item amount to match. # amount: The exact amount to match. # sell: The pattern of the item the villager sells. # Details see filters.buy. # action: Either "delete" or "replace". # replacements: A list of replacements by name as specified in trades. # Only valid if action equals "replace". # trades: Named trade patterns for replacements. # Details see filters.buy. filters: - trade: buy: - type: paper sell: type: emerald action: replace replacements: [ manybooks ] - trade: buy: - type: written_book sell: type: emerald action: replace replacements: [ manybooks ] - trade: buy: - type: wheat maxamount: 23 sell: type: emerald action: replace replacements: [ muchwheat ] trades: manybooks: buy: - type: book minamount: 32 maxamount: 64 sell: type: emerald amount: 1 muchwheat: buy: - type: wheat minamount: 24 maxamount: 64 sell: type: emerald amount: 1
Hope this gets updated. I did not test on 1.4 yet, maybe it works, just hope its not dead.
I'm praying that this is 1.4 compatible.. only because I WANT the old way of trading back.. I think that its completely resonable that someone be able to trade all their crops that they worked hard for in survival to get emearlds, and then use those emeralds to get in game currency (shop setup by the server) or trade the emeralds to other villagers for rare trades like exp pots..
Honestly i really don't see how this exploit is breaking a server.. If you work with it and adjust the price you pay to people for emeralds there should be no problem...
So i'm hoping this plugin will let me put the 1.3.2 trading option back in my server.
Does this remove all default trades as standard?
Honestly, I feel that Villagers shouldnt have enchanted gear to trade.
I actually care very much about enchantments as I have a custom enchantment system and this affects it. If you add it then I will use this. Otherwise I will just write my own. However, I wanted to reply because enchantments could be a concern to others as well.
@StarTuxDev
I just understand
Initial deals are really delete, not just "replaced" temporary :)
Thanks!
@StarTuxDev
Yes, indeed the configuration is a little hard to understand.
Any way to add instead of replace/delete. Something that when generating new npcs/new trades, there is a chance that an added trade replace a default one.
@JohOply
This config, very similar to the default one, removes the deals [paper->emeralds], [written book->emeralds] and [wheat->emeralds].
They will be replaced with [books->emeralds] and [wheat->emeralds], the latter one being more expensive than the natural deal.
I hope this clears things up. But your question actually reminds me that the configuration file is rather confusing; maybe I can fix that with the next release.
Hello!
I think that the config doesn't work, no?
But PNJ sell for example 56 books...
If i did an error, say me ! :)
Perfect plugin for my server. Kudos to you for making it!
This is the opposite of of wanted i wanted, but some others might like im sure.
I agree that trading is pretty game breaking atm
Ya.. i'm totally waiting on the edge of my seat for the download for this... can't wait to try it out, villagers are totally screwing with my servers econ/item dynamic.