Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Villager Trade Tables Mod Wiki › Guides › Trade Syntax Guide

Trade Syntax Guide

Items in the JSON files are defined as objects. This allows for high precision when specifying trade requirements.

Item Object Properties

  • id: The registry name of the item (e.g., minecraft:emerald).
  • Damage: The metadata or durability value of the item.
  • Count: The number of items. This can be a single integer or a range object.
  • NBT: A string representation of the item's NBT data (e.g., "{display:{Name:\"Legendary Sword\"}}").

Quantity Ranges

Instead of a fixed number, you can provide a range to randomize the trade costs:

"Count": { "min": 1, "max": 5 }

Example Trade JSON

Below is an example of a trade that adds a custom transaction to the Cleric career:

{
 "Profession": "minecraft:cleric",
 "Career": "cleric",
 "Offers": [
 {
 "action": "add",
 "CareerLevel": 1,
 "buy": { "id": "minecraft:rotten_flesh", "Count": 32 },
 "sell": { "id": "minecraft:emerald", "Count": 1 }
 }
 ]
}