MerchantJS
by MerrySnow
With MerchantJS, a KubeJS script can define additional villager trades and open a custom trading screen for any entity, including pigs.
What it does
MerchantJS is a Forge addon for KubeJS that extends the trading system. Scripts use it to initiate trades anywhere in the world, so an entity that cannot normally trade can offer custom trades through a customizable trading screen. Setting maxUses to 0 makes a trade appear unavailable, which lets scripts enable and disable offers selectively, a common way to gate trades behind stage-based progression.
The mod focuses on creating additional trades quickly rather than replacing vanilla trading, which already includes many mechanics. Event hooks can combine MerchantJS with dynamic trade control, and an event fires after a trade occurs, including for vanilla trades, so scripts can trigger further actions once a player has traded. Restocking is checked at an interval whenever a trade window is opened.
Features such as restocking by experience, demand, or price fluctuation are not built in, so a script author must implement them. Stock information and other trade-related data must be stored by the script, and KubeJS persistentData is suited to that purpose. Offers are defined anew each time openMerchant is called, and a refresh of trade data is needed only when the script calls for one. Servers that run it need every player to install it too. Files are published for Forge, with 1.0.0 for 1.20.6 as the latest file, and the code is open source under the GNU General Public License v3.0 only.
Key features
Custom trades for any entity
Scripts open a trading screen for entities such as pigs, with offers defined in code, not limited to villagers.
Selective trade control
A max-uses value of 0 hides an offer as unavailable, so trades can be enabled or disabled per stage.
Post-trade events
An event fires after a trade completes, including vanilla trades, to start additional actions.
Dynamic trade control
MerchantJS works together with event-driven scripts that change which trades are offered at a given time.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Questions
Does MerchantJS need KubeJS?
Does the server need MerchantJS?
Which game versions does MerchantJS support?
In the catalog
MerchantJS is one of 2,072 Economy mods on ModsFinder, and one of 1,010 Economy mods for Forge. 11,154 mods support Minecraft 1.20.6.
More from MerrySnow
Similar mods
What the author says
This mod is an addon for KubeJS, expanding its functionality in the trading system. This mod allows you to initiate trades anywhere — trade with pigs, with End Stone, with Enchanted Golden Apples, or even out of thin air!
Official listing
- Modrinth page
- modrinth.com/mod/merchantjs
- Owner
- MerrySnow
- Published
- 2025-10-26
- Updated on Modrinth
- 2025-10-26
- Facts verified
- 2026-10-15
