Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Data Trader Wiki › Guides › Add Multiple Trades to a Single Data Trader

Add Multiple Trades to a Single Data Trader

Understanding Trade Arrays

A single Data Trader can offer multiple different trades simultaneously. In your datapack JSON, trades are typically stored in an array, allowing one NPC to function like a multi-page villager.

Structuring Multiple Trades

Each trade in the array should have its own complete definition: input items, output items, and optional settings like max uses or XP rewards. Organize your JSON carefully to avoid syntax errors.

Trade Variety

You can create diverse trade chains—for example, one trade accepts raw materials and outputs processed goods, while another accepts currency items and outputs rare items. This flexibility lets you build complex trading systems.

Testing and Debugging

After adding multiple trades, reload your datapack and interact with the trader. All configured trades should appear in the trading interface. If some trades don't show, check your JSON for formatting errors, duplicate keys, or invalid item IDs. Use a JSON validator tool to catch syntax issues before testing in-game.