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.
Let's explore how to do this.
Supported Platforms
This command block program is available in the following versions of Minecraft:
Platform | Supported (Version*) |
---|---|
Java Edition (PC/Mac) | Yes (1.8) |
Pocket Edition (PE) | No |
Xbox 360 | No |
Xbox One | No |
PS3 | No |
PS4 | No |
Wii U | No |
Nintendo Switch | No |
Windows 10 Edition | No |
Education Edition | No |
* 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.
This will bring up the programming console for the command block.
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.
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.
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.
When a player pulls the lever, the command block will be activated.
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.
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:
Advertisements