Minecraft:Villager trade definition: Difference between revisions
From SAS Gaming Wiki
More actions
Sync: new page from Minecraft |
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 | ***{{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 | ** {{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 | ** {{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 | ** {{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 — {{json ref|enchantment|tag=1}} | ** {{nbt|string}}{{nbt|list|double_trade_price_enchantments}}: Optional — {{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
- Template:Nbt: The root object.
- Template:Nbt: The item needed for the trade (i.e. the price)
- Template:Nbt: The Minecraft:resource location of the item. Must not be Template:Cd
- Template:NbtTemplate:NbtTemplate:Nbt: Optional Minecraft:number provider (defaults to Template:Cd). Define the cost, number of items needed for the trade. The final cost can be altered by the additional cost (by Template:DCL and Template:NbtTemplate:Nbt). If the cost quantity is less than 1, the trade is removed. Final cost above Template:DCL are treated as Template:Cd.
- Template:Nbt: Optional map of additional (non-default) data components.
- Template:Nbt: Secondary item needed for the trade, optional. No altered by the additional cost.
- Same format as Template:Nbt
- Template:Nbt: The item given by the trade
- Template:Nbt: Optional list of modifiers to apply to the item given by the trade
- Template:Nbt: An inline Minecraft:item modifier. The Template:Cd modifier is not supported.
- Template:NbtTemplate:NbtTemplate:Nbt: Optional Minecraft:number provider (defaults to Template:Cd) determining the maximum amount of uses of this trade. Values below 1 are treated as 1.
- Template:NbtTemplate:NbtTemplate:Nbt: Optional Minecraft:number provider (defaults to Template:Cd) determining how much reputation (such as discounts and penalties) affect the count of Template:Nbt. Called 'price multiplier' in Template:Slink. Values below 0 are treated as 0.
- Template:NbtTemplate:NbtTemplate:Nbt: Optional Minecraft:number provider (defaults to Template:Cd) determining how much xp the merchant gets when the trade is done. Values below 0 are treated as 0.
- Template:NbtTemplate:Nbt: Optional Minecraft:predicate on the merchant that needs to pass for this trade to be offered. The Template:Cd predicate is not supported.
- Template:NbtTemplate:Nbt: Optional — Template:Json ref. If present in the item Template:Nbt's Template:DCL component after the execution of Template:Nbt, doubles the additional cost (defined by the Template:DCL component) of the item Template:Nbt.
- Template:Nbt: The item needed for the trade (i.e. the price)
History
Template:Navbox Java Edition technical
Minecraft:de:Handelsdefinition Minecraft:ja:取引のカスタマイズ Minecraft:pt:Definição de comércio do aldeão Minecraft:zh:村民交易定义格式