Use Command Block to Summon Villager with Customized Trade

This Minecraft tutorial explains how to program a command block to summon a villager to do a custom trade in Minecraft with screenshots and step-by-step instructions.

console command

Let's explore how to do this.

Supported Platforms

This command block program is available in the following versions of Minecraft:

PlatformSupported (Version*)
Java Edition (PC/Mac) Java Edition (PC/Mac)Yes (1.8)
Pocket Edition (PE) Pocket Edition (PE)No
Xbox 360 Xbox 360No
Xbox One Xbox OneNo
PS3 PS3No
PS4 PS4No
Wii U Wii UNo
Nintendo Switch Nintendo SwitchNo
Windows 10 Edition Windows 10 EditionNo
Education Edition Education EditionNo

* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.

Required Materials

In Minecraft, these are the required materials to use a command block:

Program the Command Block

First, you need to program the command block to summon a villager with the /summon command. This /summon command will be run each time the command block is activated.

So, stand in front of the command block with your pointer (the plus sign) on the command block and click on the right mouse button.

open command block

This will bring up the programming console for the command block.

console command

Now, type your command in the "Console Command" text box.

In this example, we are going to create a villager that is named DigMinecraft. The villager will trade 1 leather for 1 bedrock and you will be able to do this trade a maximum of 9 times.

You can customize this command to make the villager trade whatever you would like.

TIP: See data tags for villager to learn more about the Offers data tag.

For example, replace id:leather with the item id you would like the villager to buy. And replace the id:bedrock value with the item that you would like the villager to sell. See our list of Minecraft IDs.

You can also customize the Count parameter to change the number of items used in the trade. Currently, the command uses Count:1 which indicates that 1 unit of each item is being traded.

Finally, you can customize the maxUses parameter to indicate how many times the villager can do this trade. In this example, we've set it to 9.

console command

When you are finished entering the command, click on the Done button.

Activate the Command Block

Now, activate the command block with the redstone device such as a lever, button, or pressure plate. In this example, we are going to use a lever to activate the command block.

open command block

When a player pulls the lever, the command block will be activated.

console command

Now you will see a villager summoned that is named DigMinecraft. If you right click on the villager, you will see that it will trade 1 leather for 1 bedrock.

console command

Congratulations, you have learned how to program a command block to summon a villager that will buy and sell what you want it to.

Villager Trade Generator

If you need help writing your custom trades, try using our villager trade generator:

Command Block Programs

Here are some command block programs that you can try: