VOOZH about

URL: https://minecraft.wiki/w/Villager_trade_definition

โ‡ฑ Villager trade definition โ€“ Minecraft Wiki


Villager trade definition

From Minecraft Wiki
Jump to navigation Jump to search

Villager trades are stored as JSON files within a data pack in the path data/<namespace>/villager_trade. Despite their name, they also control the trades of wandering traders.

JSON format

[edit | edit source]
  • [NBT Compound / JSON Object]: The root object.
    • [NBT Compound / JSON Object] wants: The item needed for the trade (i.e. the price)
    • [NBT Compound / JSON Object] additional_wants: Secondary item needed for the trade
      • Same format as [NBT Compound / JSON Object] wants
    • [NBT Compound / JSON Object] gives: The item given by the trade
    • [NBT List / JSON Array] given_item_modifiers: Optional list of modifiers to apply to the item given by the trade
      • [NBT Compound / JSON Object]: An inline item modifier. The reference modifier is not supported.
    • [Int][Float][NBT Compound / JSON Object] max_uses: Optional number provider (defaults to 4, minimum 1) determining the maximum amount of uses of this trade.
    • [Int][Float][NBT Compound / JSON Object] reputation_discount: Optional number provider (defaults to 0, minimum 0) determining how much reputation (such as discounts and penalties) affect the count of [NBT Compound / JSON Object] wants. โ€‹[more information needed]
    • [Int][Float][NBT Compound / JSON Object] xp: Optional number provider (defaults to 1, minimum 0) determining how much xp the merchant gets when the trade is done.
    • [NBT List / JSON Array][NBT Compound / JSON Object] merchant_predicate: Optional predicate on the merchant that needs to pass for this trade to be offered. The reference predicate is not supported.
    • [String][NBT List / JSON Array] double_trade_price_enchantments: Optional โ€” Any number of enchantment(s) (an [String] ID, or a [String] tag with #, or an [NBT List / JSON Array] array containing [String] IDs) that when present after [NBT List / JSON Array] given_item_modifiers is run double the count of the [NBT Compound / JSON Object] wants item (when the additional_trade_cost item component is present).

History

[edit | edit source]
Java Edition
26.1snap1Villager trades are now data-driven.

Navigation

[edit | edit source]
Retrieved from "https://minecraft.wiki/w/Villager_trade_definition?oldid=3493953"

Navigation menu