Use Command Blocks to Teleport Player with Item
This Minecraft tutorial explains how to program command blocks to teleport a player if they have a specific item in their inventory 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 create this command block program:
Steps to Build this Command Block Program
1. Place the first Command Block
Start by placing the first command block which will be used to test if a player has a specific item in their inventory (sort of like a "quest item"). In this tutorial, we will test if a player has paper in their inventory.
2. Program the first Command Block
Now open the command block so that you can program it.
Since we want to test if the player has paper in their inventory, we will enter the following /testfor command:
After entering the command, make sure that the buttons in the Console are set to Impulse, Unconditional and Needs Redstone.
When you are finished, click on the Done button.
3. Place the second Command Block
Now, you need to place a second command block that will be configured as a chain command block.
Place the second command block in front of the first. Notice the direction of the arrows on the command blocks. This is very important and indicates the order that the command blocks will run! The direction of the arrows must look like the picture below.
4. Program the second Command Block
Now open the second command block so that you can program it.
Since we want to teleport the player to coordinates (216,63,335) if they have paper, we will enter the following /tp command:
/tp @p 216 63 335
Make sure that the buttons in the Console are set to Chain, Conditional and Always Active.
When you are finished, click on the Done button.
5. Place the Pressure Plate
Now, you need to place a pressure plate next to the regular command block. This is the pressure pressure that the player will stand on to activate the command block program.
6. Now Activate the Command Blocks
When the command blocks are activated, they will be run in the order as displayed by the arrows on the sides of the blocks (left to right).
Now when a player stands on the pressure plate and has paper in their inventory, they will be teleported to coordinates (216,63,335).
Congratulations, you have learned how to program command blocks to teleport a player when they have a specific item in their inventory.
Command Block Programs
Here are some command block programs that you can try:
Advertisements