{{indexmenu_n>5}} ====== Trades ====== Trades determine what specific item stack a [[mc>Villager]] or [[mc>Wandering_Trader|Wandering Trader]], usually grouped together as [[entities:merchants]], wants to trade with a player. These trades can be found in a data pack under the ''trade'' folder in a namespace. They are then used in [[mc>Tag|trade tags]] so a merchant can choose their respective trades. ===== Fields ===== ^ Name ^ Description ^ Type ^ Default Value ^ | ''wants'' | The item stacks the merchant wants from the player. | A list of 1 to 2 [[trades:trade_entries|trade entries]] | | | ''gives'' | The item stack the merchant gives to the player. | A [[trades:trade_entries|trade entry]] | | | ''max_uses'' | How often a player can trade this trade with a merchant before the trade gets disabled. | A positive integer | | | ''trade_experience'' | The amount of trade experience to grant the merchant upon trading. | An optional integer | ''1'' | | ''price_multiplier'' | The multiplier that affects the price of the first wanted item stack based on the trade's demand. | An optional float | ''0.0'' | | ''trade_modifier'' | The modifier to apply to the whole trade. | A [[trades:trade_modifiers:start|trade modifier]] | | ===== Example ===== { "wants": [ { "item": "minecraft:emerald", "count": 2 }, { "item": "minecraft:book" } ], "gives": { "item": "minecraft:book" }, "max_uses": 12, "trade_experience": 15, "price_multiplier": 0.2, "trade_modifier": { "type": "minecraft:single_enchantment", "index": 0, "base_random_cost": 5, "per_level_random_cost": 10, "per_level_cost": 3, "enchantments": "#minecraft:tradeable", "levels": { "min": 1 } } }