Trading with villagers in Minecraft is simply awesome. But you know what's totally not awesome? The villager trading interface, it's actually quite terrible, really...
But not anymore! This mod completely replaces the old trading interface with something much more visually pleasing and feature packed at the same time.
As mentioned this mod completely replaces / overhauls the trading interface. Here is a list of all the features it includes:
- Offers are now displayed in a trading book on the left side of the trading interface, very similar to the vanilla recipe book in the crafting table interface. It consists of a search bar on top, a scrollable list of the available offers and a scrollbar to the right.
- The outline of each offer button can be one of three colours: grey = default state, red = the player doesn't have enough items in their inventory to trade, green = the offer is currently selected and can be used by putting the required items into the trading input slots.
- Left-clicking a grey or green offer button will automatically place the items required to trade once into the trading input slots. Shift left-clicking will place in as many items as possible.
- Right-clicking a grey or green offer button will automatically trade the offer once. Shift right-clicking will automatically trade until the offer is locked or the player runs out of items.
- Clicking a red offer button will display a ghost offer in the three trading slots to show where items have to placed. This works exactly like the ghost recipe from the vanilla recipe book.
- A search bar is added which helps finding offers as quickly as possible. It works exactly like the creative inventory search meaning the contents of tooltips are taken into account. Two optional special characters are supported which will have to be typed as the first character for each search: "<" will only search the items the villager is buying, ">" on the other hand only searches items the villager is selling.
- You now see the villager you're trading with inside of the interface!
- Items can be shift-clicked into the two trading input slots. And this feature is smart! It will never fill a secound slot with an item that's already in the other one so that trading isn't blocked.
- Items are put back into the player inventory on closing the interface if left in the trading input slots instead of being dropped on the ground.
- Each villager remembers the last offer that was selected so you can pick up right where you left off after the trading interface has been reopened.
For some examples on these features in-game see the Image section.
Check out my other projects here.
Thanks to MineMaarten and his Advanced Modding Tutorials series which helped me a lot figuring out how to properly use the SimpleImpl system in Forge. Also thanks to BarracudaATA on whose PrivateAccessor class I built mine on top of.
This mod is available in the public domain. Do whatever you want, use it wherever you want. The source code can be found on Github.