User Tools

Site Tools


trades:start

Table of Contents

Trades

Trades determine what specific item stack a Villager or Wandering Trader, usually grouped together as Merchants, wants to trade with a player. These trades can be found in a data pack under the trade folder in a namespace. They are then used in trade tags so a merchant can choose their respective trades.

Fields

Name Description Type Default Value
wants The item stacks the merchant wants from the player. A list of 1 to 2 trade entries
gives The item stack the merchant gives to the player. A trade entry
max_uses How often a player can trade this trade with a merchant before the trade gets disabled. A positive integer
trade_experience The amount of trade experience to grant the merchant upon trading. An optional integer 1
price_multiplier The multiplier that affects the price of the first wanted item stack based on the trade's demand. An optional float 0.0
trade_modifier The modifier to apply to the whole trade. A trade modifier

Example

{
  "wants": [
    {
      "item": "minecraft:emerald",
      "count": 2
    },
    {
      "item": "minecraft:book"
    }
  ],
  "gives": {
    "item": "minecraft:book"
  },
  "max_uses": 12,
  "trade_experience": 15,
  "price_multiplier": 0.2,
  "trade_modifier": {
    "type": "minecraft:single_enchantment",
    "index": 0,
    "base_random_cost": 5,
    "per_level_random_cost": 10,
    "per_level_cost": 3,
    "enchantments": "#minecraft:tradeable",
    "levels": {
      "min": 1
    }
  }
}
trades/start.txt · Last modified: 2024/05/14 21:01 by errorcraft