Skip to content

Villager Trade Data Format

All trade definition files belong in data/numismatic-overhaul/villager_trades. You can define as many files for a villager profession as you like, although having multiple files per profession is discouraged for the sake of simplicity.

All the trades are collected based on profession, and for each level the villager randomly picks their trades.

Wandering Trader

The Wandering Trader is a special case. Its profession ID is wandering_trader, and it only requires trades for the novice and apprentice levels. Any other trades will not load.

File Format

Each trade definition file needs two elements in the root object:

  • profession: The profession the following trades are for, without namespace (eg. "profession": "farmer")

  • trades: The trades for this profession, one array for each level

Example:

json
{
  "profession": "farmer",
  "trades": {
    "novice": [
      {
        "type": ...
        ...options...
      },
      {
        "type": ...
        ...options...
      }
    ]
  }
}

ItemStack format

PropertyDescriptionType
idThe item IDstring
countThe item countint optional
tagAn NBT tagA nested object optional

Example

json
    {
      "id": "minecraft:diamond_pickaxe",
      "count": 1
      "tag": {
        "Damage": 75
      }
    }
    ```

Trade Types

All trades types have these optional parameters:

ParameterDescriptionTypeDefault
price_multiplierThe multiplier to apply when a player has gossipfloat0.05
max_usesThe max uses of this trade before restockingint12
villager_experienceThe experience awarded to the villager when using this tradeint5

Buy Item

numismatic-overhaul:buy_stack

The Villager buys the given stack for the given price

ParameterDescriptionType
pricePrice in bronze coinsint
buyThe item to buyItemStack

Example

json
{
  "type": "numismatic-overhaul:buy_item",
  "buy": {
    "item": "minecraft:brown_wool",
    "count": 6
  },
  "price": 74000
}

Sell Item

numismatic-overhaul:sell_stack

The Villager sells the given stack for the given price

ParameterDescriptionType
pricePrice in bronze coinsint
sellThe item to sellItemStack

Example

json
{
  "type": "numismatic-overhaul:sell_stack",
  "sell": {
    "item": "minecraft:cookie",
    "count": 2
  },
  "price": 65,
  "max_uses": 2
}

Process Item

numismatic-overhaul:process_item

Sells an item for another item and some money

ParameterDescriptionType
sellThe item to sellItemStack
buyThe item to processItemStack
priceThe price in bronze coinsint

Example

json
{
  "type": "numismatic-overhaul:process_item",
  "sell": {
    "item": "minecraft:diamond"
  },
  "buy": {
    "item": "minecraft:emerald"
  },
  "price": 2000
}

Sell Map

numismatic-overhaul:sell_map

Sells a map for a specific structure

ParameterDescriptionType
priceThe price in bronze coinsint
structureThe structure id, you can find these out using /locatestring

Example

json
{
  "type": "numismatic-overhaul:sell_map",
  "structure": "minecraft:endcity",
  "price": 5,
  "villager_experience": 20
}

Sell Item in Dimension

numismatic-overhaul:dimension_sell_stack

Sells the given stack for the given price, but only if the villager is in the given dimension

ParameterDescriptionType
priceThe price in bronze coinsint
sellThe item to sellItemStack
dimensionThe dimension to sell instring

Example

json
{
  "type": "numismatic-overhaul:dimension_sell_stack",
  "sell": {
    "item": "minecraft:cookie",
    "count": 2
  },
  "price": 65,
  "max_uses": 2,
  "dimension": "minecraft:the_end"
}

Sell Single Enchantment

numismatic-overhaul:sell_single_enchantment

Sells a single random enchantment, prices are calculated based on the generated enchantments

ParameterDescriptionType
price_multiplierMultiplier for the priceint optional

Example

json
{
  "type": "numismatic-overhaul:sell_single_enchantment",
  "price_multiplier": 0.75
}

Sell Enchanted Item

numismatic-overhaul:enchant_item

Sells an item enchanted at the given level, prices are calculated based on the generated enchantments

ParameterDescriptionTypeDefault
levelThe level to enchant with, may exceed 30int
base_priceA base price in bronze coins on which to base calculationsint optional200
allow_treasureWhether to allow treasure enchantmentsboolean optionalfalse
itemThe item to enchantItemStack optionalminecraft:book

Example

json
{
  "type": "numismatic-overhaul:enchant_item",
  "base_price": 250,
  "level": 30,
  "allow_treasure": true,
  "item": {
    "item": "minecraft:diamond_sword"
  }
}

Sell Dyed Armor

numismatic-overhaul:sell_dyed_armor

Sells a piece of randomly dyed piece of leather armor

ParameterDescriptionType
itemThe ID of the item to dyestring
priceThe price in bronze coinsint

Example

json
{
  "type": "numismatic-overhaul:sell_dyed_armor",
  "item": "minecraft:leather_boots",
  "price": 200730
}

Sell Potion Container Item

numismatic-overhaul:sell_potion_container

Sells an item that can have a potion effect applied (eg. potions, tipped arrows) with a random potion effect

ParameterDescriptionType
container_itemThe item to apply the potion effect toItemStack
buy_itemThe item to buyItemStack
priceThe price in bronze coinsint

Example

json
{
  "type": "numismatic-overhaul:sell_potion_container",
  "container_item": {
    "item": "minecraft:potion"
  },
  "buy_item": {
    "item": "minecraft:potion",
    "tag": {
      "Potion": "minecraft:water"
    }
  },
  "price": 76
}