Wandering trader

The **wandering trader** is a passive mob found randomly across the world. It can trade, making natural items more available and in some cases, less dangerous to obtain.

## Spawning

The wandering trader appears randomly across the world with 2 leashed trader llamas. In *Bedrock Edition*, wandering traders periodically spawn in village gathering sites, usually near village meeting points.

At any time, there can be only one wandering trader naturally spawned in the world. After 24000 ticks (20 real-life minutes, or 1 Minecraft day) have passed since the world is created, the game attempts to spawn a wandering trader.[note 1] If there are no wandering traders currently in the world, the game tries to spawn a new wandering trader after every following 24000 ticks, within a 48-block radius of a player. The first spawn attempt has a 2.5% chance of success; if it fails, after another 24000 ticks another spawn attempt is made with a 5% chance of success. If that fails, for all subsequent spawn attempts the chance caps at 7.5%. On average, it takes 14.325 Minecraft days for a wandering trader to spawn. After 48000 or 72000 ticks, the trader despawns, even when named, along with its llamas, resetting the cycle.

Trader llamas do not despawn if they are detached from the wandering trader's leads.

In *Bedrock Edition*, when using spawn eggs or the `/summon` command to spawn a wandering trader, llamas always spawn with it. Wandering traders never spawn if `/mobevent` `minecraft:wandering_trader` is set to false.

## Behavior

The wandering trader has 6 random trades. New trades are not unlocked after trading with it.

After spawning, the wandering trader has a managed schedule for 40–60 minutes. After the time expires, the wandering trader despawns, even if the wandering trader is named with a name tag or put in a vehicle such as a minecart or boat. A wandering trader despawns sooner if all trades have been locked. The trader may later respawn with new trades.

The wandering trader can sometimes form a caravan, due to wild llamas that follow the leashed trader llama(s).

Wandering traders drink a potion of invisibility during dusk. At dawn they drink milk to remove the invisibility.‌[*JE only*]

Wandering traders avoid zombies and their variants, all illager variants, and vexes, staying at least 8 blocks away. Unlike other villagers, a wandering trader killed by zombies does not become a zombie villager.[1]

Wandering traders drink potions of invisibility if hurt by magic attacks or projectiles from hostile mobs, or when avoiding illagers, vexes, and zombies.‌[*BE only*]

When attacked by a player, a wandering trader flees from the player as a villager would do. The llamas, however, attack the player if their master gets hit.

Like villagers, wandering traders can also close and open wooden doors.‌[*BE only*]

Unlike most other villager-like mobs, wandering traders do not visually sit down when riding objects such as boats and minecarts, which is intentional.[2]

## Drops

* a milk bucket (8.5% chance, increased 1% per level of Looting).‌[*JE only*]
* a potion of invisibility (8.5% chance, increased 1% per level of Looting) if killed while holding or before finishing drinking.

A wandering trader also drop leads when killed or when separated too far from its trader llamas. The leads break and appear at the position of the llamas. The llamas also drop their leads when killed, and if a wandering trader and one of its llamas are riding the same boat, the lead breaks.

## Trading

For the available trades for the wandering trader, see Trading § Wandering trader The trading system is a gameplay mechanic that allows players to buy items with emeralds.

A player can click on the wandering trader to view the items offered for sale. Different offers may be viewed by pressing the left and right buttons next to the currently displayed offer. All offers involve emeralds as a currency. A wandering trader has an emerald above its head while trading‌[*BE only*] and typically sells items generated in the world or otherwise related to nature, such as plants, dyes, and buckets of fish. They can also trade less common items, such as coral or blue ice.

After the player purchases the same item several times, the wandering trader locks the trade, but unlike villagers, never unlocks the trade.

Unlike villagers, Wandering Traders only sell items and do not buy them. Wandering Traders do not have an experience bar and do not modify their offers based on increased or decreased demand. This can be changed by the player by editing the corresponding NBT data flag through use of the data command.

## Data values[edit]

See also: Chunk format

Wandering traders have entity data associated with them that contain various properties of the mob.

* Entity data
	+ Tags common to all entities [show]
	+ Tags common to all mobs [show]
	+ Additional fields for mobs that can breed [show]
	+ DespawnDelay: The number of ticks until this wandering trader is forced to despawn.
	+ WanderTarget: Destination toward where this trader wanders.
		- X: The X coordinate to wander toward.
		- Y: The Y coordinate to wander toward.
		- Z: The Z coordinate to wander toward.
	+ Offers: Is generated when the trading menu is opened for the first time.
		- Recipes: List of trade options.
			* A trade option.
				+ rewardExp: 1 or 0 (true/false) - true if this trade provides XP orb drops. All trades from naturally-generated villagers in Java Edition reward XP orbs.
				+ maxUses: The maximum number of times this trade can be used before it is disabled. Increases by a random amount from 2 to 12 when offers are refreshed.
				+ uses: The number of times this trade has been used. The trade becomes disabled when this is greater or equal to maxUses.
				+ buy: The first 'cost' item, without the Slot tag.
					- Tags common to all items [show]
				+ buyB: May not exist. The second 'cost' item, without the Slot tag.
					- Tags common to all items [show]
				+ sell: The item being sold for each set of cost items, without the Slot tag.
					- Tags common to all items [show]

## History[edit]

 19w06a
 19w09a
 1.10.0
 1.11.0
 beta 1.11.0.4
 1.12.0
 1.91