Trade set

Minecraft Wiki article. Categories: Data_packs

📌 Mirrored from Minecraft Wiki

This article is reproduced from Trade set on the Minecraft Wiki. Mirrored from revision 3691171. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.

A trade set is a grouping of trades offered by villagers and wandering traders.

Usage

Trade sets are defined in data packs in the path data/<namespace>/trade_set. Only 68 specific hardcoded trade sets are used by the game. Overriding them modifies the trades offered by villagers or wandering traders. Creating new trade sets has no effect. Nitwit and unemployed do not have a trade set, even if added by datapecks.

The hardcoded trade sets are:

  • minecraft:<villager profession>/level_<level> — Trades are unlocked when a villager with profession <villager profession> level up to level <level>. For level 1, trades unlocked when the unemployed villager changes to profession <villager profession>.
  • minecraft:wandering_trader/buying — First trades of the wandering trader.
  • minecraft:wandering_trader/uncommon — Middle trades of the wandering trader.
  • minecraft:wandering_trader/common — Last trades of the wandering trader.
Villager Professions[a]
Profession ID
Armorer armorer
Butcher butcher
Cartographer cartographer
Cleric cleric
Farmer farmer
Fisherman fisherman
Fletcher fletcher
Leatherworker leatherworker
Librarian librarian
Mason mason
Shepherd shepherd
Toolsmith toolsmith
Weaponsmith weaponsmith
  1. ↑ Except nitwit (nitwit) and unemployed (none)
Trade Level
Level ID
Novice 1
Apprentice 2
Journeyman 3
Expert 4
Master 5

JSON format

  • [NBT Compound / JSON Object]: The root object
    • [String][NBT List / JSON Array] trades: Any number of villager trade(s) (an [String] ID, or a [String] tag with #, or an [NBT List / JSON Array] array containing [String] IDs) to pick from.
    • [Int][Float][NBT Compound / JSON Object] amount: A number provider determining the amount of trades to generate when this set is used.
    • [Boolean] allow_duplicates: (Optional, defaults to false) Whether a single trade can be selected multiple times.
    • [String] random_sequence: The random sequence to use to generate trades. When unset, a non-deterministic random sequence is used.

History

Java Edition
26.1snap1Added trades sets.

Sources