This Minecraft tutorial explains how to use the /testforblocks command with screenshots and step-by-step instructions.

You can test whether the blocks in two regions match using the /testforblocks command in Minecraft.

TIP: Starting in Minecraft Java Edition (PC/Mac) 1.13, the /testforblocks command was removed from the Java Edition version of the game.

Let’s explore how to use this cheat (game command).

Requirements

To run game commands in Minecraft, you have to turn cheats on in your world.

TestForBlocks Command

TestForBlocks Command in Minecraft Java Edition (PC/Mac)

In Minecraft Java Edition (PC/Mac) 1.8, 1.9, 1.10, 1.11 and 1.12, the syntax to test whether the blocks in two regions match is:

/testforblocks <x1> <y1> <z1>  <x2> <y2> <z2>  <x> <y> <z> [mode]

Definitions

  • <x1> <y1> <z1> is the starting coordinate for the source region of blocks to compare (ie: first corner block).
  • <x2> <y2> <z2> is the ending coordinate for the source region of blocks to compare (ie: opposite corner block).
  • <x> <y> <z> is the coordinate for the destination region of blocks. Use the lowest x,y,z values for the destination. This will be the bottom NorthWest corner of the destination region.
  • mode is optional. It tells the command whether to filter the blocks that are being compared. The default behavior is all. It can be one of the following values:
    • all – All blocks in the source and destination regions are compared and must match exactly.
    • masked – Air blocks in the source region are excluded and are not compared against the corresponding blocks in the destination region. All other blocks (non-air blocks) must match exactly in the source and destination regions.

TIP: Read our tutorial called Understanding the Coordinate System to learn about the XYZ coordinates in Minecraft and how to find your current coordinates.

Examples

Example in Java Edition (PC/Mac) 1.11 and 1.12

To compare a source region from the starting coordinate (229, 64, 335) to the ending coordinate (205, 75, 358) against the destination coordinate (173, 64, 254):

/testforblocks 229 64 335   205 75 358   173 64 254

To compare a source region from the starting coordinate (299, 74, 238) to the ending coordinate (288, 88, 224) against the destination coordinate that is 19 blocks West and 10 blocks North of our current position:

/testforblocks 299 74 238   288 88 224   ~-19 ~ ~-10 masked

To compare a source region from the starting coordinate (~ ~-3 ~) to the ending coordinate (~5 ~5~ 5) against the destination coordinate (~10 ~10 ~10):

/testforblocks ~ ~-3 ~   ~5 ~5 ~5   ~10 ~10 ~10

How to Enter the Command

1. Open the Chat Window

The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:

  • For Java Edition (PC/Mac), press the T key to open the chat window.
  • For Pocket Edition (PE), tap on the chat button  at the top of the screen.
  • For Xbox One, press the D-Pad (right)  on the controller.
  • For PS4, press the D-Pad (right)  on the controller.
  • For Nintendo Switch, press the right arrow button  on the controller.
  • For Windows 10 Edition, press the T key to open the chat window.
  • For Education Edition, press the T key to open the chat window.

2. Type the Command

In this example, we will compare a source region from the starting coordinate (229, 64, 335) to the ending coordinate (205, 75, 358) against the destination coordinate (173, 64, 254) with the following command:

/testforblocks 229 64 335   205 75 358   173 64 254

Type the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.

Once the cheat has been entered, the blocks within the two regions will be compared.

In this example, the two regions did not match, so you will see the message “Source and destination are not identical” appear in the lower left corner of the game window.

Congratulations, you have learned how to use the /testforblocks command in Minecraft.

Click to rate this post!
[Total: 2 Average: 5]