Minecraft:Villager trade definition: Difference between revisions
From SAS Gaming Wiki
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 14: | Line 14: | ||
** {{nbt|compound|gives}}: The item given by the trade | ** {{nbt|compound|gives}}: The item given by the trade | ||
*** {{nbt inherit/itemnoslot}} | *** {{nbt inherit/itemnoslot}} | ||
** {{nbt|list| | ** {{nbt|list|given_item_modifier}}: 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}}: An inline value of a {{cd|context_int_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|max_uses}}: An inline value of a {{cd|context_int_provider}} (defaults to {{cd|4}}) determining the maximum amount of uses of this trade. Values below 1 are treated as 1. | ||
Latest revision as of 11:24, 19 September 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: An inline value of a Template:Cd (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: An inline value of a Template:Cd (defaults to Template:Cd) determining the maximum amount of uses of this trade. Values below 1 are treated as 1.
- Template:NbtTemplate:NbtTemplate:Nbt: An inline value of a Template:Cd (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: An inline value of a Template:Cd (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:村民交易定义格式