Trade your whole stock with a merchant in a single shift-click.
This one's counter-intuitive, so worth stating: vanilla already chains trades when you
shift-click a merchant's result slot (AbstractContainerMenu.doClick re-runs
quickMoveStack in a loop). But it only consumes what you manually placed in the 2
payment slots (~2 stacks), and never refills those slots from the rest of your
inventory.
This mod adds exactly one thing: it refills the payment slots from your inventory before each trade. Result: one shift-click trades your whole relevant stock instead of stopping after 2 stacks. It's a quality-of-life refinement (trading halls, converting resources to emeralds), not a missing feature.
It respects villager restock limits — when a trade runs out of stock, bulk trading stops, exactly like vanilla. No stock bypass, no duping.
Implementation: a single Mixin (@Inject at the HEAD of quickMoveStack, result slot)
that calls the vanilla moveFromInventoryToPaymentSlot, then lets vanilla do the trade.
No duplicated trade logic. Server-side, no dependencies.
| Config (server) | Default | Effect |
|---|---|---|
enabled |
true |
Toggles the refill. false = strict vanilla behavior. |
Requires JDK 21. Gradle wrapper included.
cd bulk-trade
./gradlew build # -> build/libs/bulktrade-0.1.0.jar
./gradlew runClient # test client with the mod loadedThe first build decompiles Minecraft (slow, then cached); later builds take seconds.
In IntelliJ: "Open" the bulk-trade folder, then run the runClient run configuration.
- Creative world, a villager with a profession (or a wandering trader).
- Select a trade and place payment as usual (clicking the trade auto-fills the slots).
- Shift-click the result slot.
- Expected: the trade repeats until your payment stock is drained (not just the 2 slots),
and stops when the villager runs out of stock. Compare
enabled=false(stops after ~2 stacks) vstrue.
Leftover payment in the slots is returned to your inventory when the menu closes
(MerchantMenu.removed), so no items are lost.
- Loader: NeoForge
- Minecraft: 1.21.1
- Runs on any NeoForge
21.1.x(seeversionRangeinneoforge.mods.toml).
☕ If this mod is useful to you: buy me a coffee on Ko-fi