Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Villager trade definition: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: new page from Minecraft
 
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
Line 5: Line 5:
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: The root object.
* {{nbt|compound}}: The root object.
** {{nbt|compound|wants}}: The item needed for the trade (i.e. the price)
** {{nbt|compound|wants}}: The item needed for the trade (i.e. the price) <!-- This is not "A single item stack"! A single item stack uses a count as an integer and is limited from 1 to 99; this is a number provider with no limit. Please do not change it, even if you add the count information elsewhere. -->
*** {{nbt inherit/itemnoslot}}
***{{nbt|string|id}}: The [[Minecraft:resource location]] of the item. Must not be {{cd|minecraft:air}}
** {{nbt|compound|additional_wants}}: Secondary item needed for the trade
*** {{nbt|int}}{{nbt|float}}{{nbt|compound|count}}: Optional [[Minecraft:number provider]] (defaults to {{cd|1}}). Define the cost, number of items needed for the trade. The final cost can be altered by the additional cost (by {{DCL|additional_trade_cost}} and {{nbt|string}}{{nbt|list|double_trade_price_enchantments}}). If the cost quantity is less than 1, the trade is removed. Final cost above {{DCL|max_stack_size}} are treated as {{cd|max_stack_size}}.
*** {{nbt|compound|components}}: Optional map of additional (non-default) data components.
**** See [[Minecraft:Data component format]].
** {{nbt|compound|additional_wants}}: Secondary item needed for the trade, optional. No altered by the additional cost.
*** Same format as {{nbt|compound|wants}}
*** Same format as {{nbt|compound|wants}}
** {{nbt|compound|gives}}: The item given by the trade
** {{nbt|compound|gives}}: The item given by the trade
Line 13: Line 16:
** {{nbt|list|given_item_modifiers}}: Optional list of modifiers to apply to the item given by the trade
** {{nbt|list|given_item_modifiers}}: Optional list of modifiers to apply to the item given by the trade
*** {{nbt|compound}}: An inline [[Minecraft:item modifier]]. The {{cd|reference}} modifier is not supported.
*** {{nbt|compound}}: An inline [[Minecraft:item modifier]]. The {{cd|reference}} modifier is not supported.
** {{nbt|int}}{{nbt|float}}{{nbt|compound|max_uses}}: Optional [[Minecraft:number provider]] (defaults to {{cd|4}}, minimum {{cd|1}}) determining the maximum amount of uses of this trade.
** {{nbt|int}}{{nbt|float}}{{nbt|compound|max_uses}}: Optional [[Minecraft:number provider]] (defaults to {{cd|4}}) determining the maximum amount of uses of this trade. Values below 1 are treated as 1.
** {{nbt|int}}{{nbt|float}}{{nbt|compound|reputation_discount}}: Optional [[Minecraft:number provider]] (defaults to {{cd|0}}, minimum {{cd|0}}) determining how much reputation (such as discounts and penalties) affect the count of {{nbt|compound|wants}}. {{more info|how is this calculated?}}
** {{nbt|int}}{{nbt|float}}{{nbt|compound|reputation_discount}}: Optional [[Minecraft:number provider]] (defaults to {{cd|0}}) determining how much reputation (such as discounts and penalties) affect the count of {{nbt|compound|wants}}. Called 'price multiplier' in {{slink|Trading|Sale prices}}. Values below 0 are treated as 0.
** {{nbt|int}}{{nbt|float}}{{nbt|compound|xp}}: Optional [[Minecraft:number provider]] (defaults to {{cd|1}}, minimum {{cd|0}}) determining how much xp the merchant gets when the trade is done.
** {{nbt|int}}{{nbt|float}}{{nbt|compound|xp}}: Optional [[Minecraft:number provider]] (defaults to {{cd|1}}) determining how much xp the merchant gets when the trade is done. Values below 0 are treated as 0.
** {{nbt|list}}{{nbt|compound|merchant_predicate}}: Optional [[Minecraft:predicate]] on the merchant that needs to pass for this trade to be offered. The {{cd|reference}} predicate is not supported.
** {{nbt|list}}{{nbt|compound|merchant_predicate}}: Optional [[Minecraft:predicate]] on the merchant that needs to pass for this trade to be offered. The {{cd|reference}} predicate is not supported.
** {{nbt|string}}{{nbt|list|double_trade_price_enchantments}}: Optional &mdash; {{json ref|enchantment|tag=1}} that when present after {{nbt|list|given_item_modifiers}} is run double the count of the {{nbt|compound|wants}} item (when the {{cd|additional_trade_cost}} [[Minecraft:item component]] is present).
** {{nbt|string}}{{nbt|list|double_trade_price_enchantments}}: Optional &mdash; {{json ref|enchantment|tag=1}}. If present in the item {{nbt|compound|gives}}'s {{DCL|stored_enchantments}} component after the execution of {{nbt|list|given_item_modifiers}}, doubles the additional cost (defined by the {{DCL|additional_trade_cost}} component) of the item {{nbt|compound|wants}}.
</div>
</div>



Latest revision as of 11:13, 27 July 2026

Villager Minecraft:trades are stored as Minecraft:JSON files within a Minecraft:data pack in the path Template:Cd. Despite their name, they also control the trades of Minecraft:wandering traders.

JSON format

History

Template:HistoryTable

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Handelsdefinition Minecraft:ja:取引のカスタマイズ Minecraft:pt:Definição de comércio do aldeão Minecraft:zh:村民交易定义格式