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.
Let's explore how to use this cheat (game command).
* 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.
- Java
- PE
- Xbox
- PS
- Nintendo
- Win10
- Edu
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.
TestForBlocks Command in Minecraft Pocket Edition (PE)
In Minecraft Pocket Edition (PE), the syntax to test whether the blocks in two regions match is:
/testforblocks <begin> <end> <destination> [masked¦all]
Definitions
- begin is the starting x y z coordinate for the source region of blocks to compare (ie: first corner block).
- end is the ending x y z coordinate for the source region of blocks to compare (ie: opposite corner block).
- destination is the x y z 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.
- all is optional. It tells the command to compare all blocks in the source and destination region. All blocks must match exactly in the source and destination regions. This is the default behavior.
- masked is optional. It tells the command to exclude air blocks in the source region from being compared to the corresponding blocks in the destination region. All other blocks (non-air blocks) must match exactly in the source and destination regions.
TestForBlocks Command in Minecraft Xbox One Edition
In Minecraft Xbox One Edition, the syntax to test whether the blocks in two regions match is:
/testforblocks <begin> <end> <destination> [masked¦all]
Definitions
- begin is the starting x y z coordinate for the source region of blocks to compare (ie: first corner block).
- end is the ending x y z coordinate for the source region of blocks to compare (ie: opposite corner block).
- destination is the x y z 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.
- all is optional. It tells the command to compare all blocks in the source and destination region. All blocks must match exactly in the source and destination regions. This is the default behavior.
- masked is optional. It tells the command to exclude air blocks in the source region from being compared to the corresponding blocks in the destination region. All other blocks (non-air blocks) must match exactly in the source and destination regions.
TestForBlocks Command in Minecraft PS4 Edition
In Minecraft PS4 Edition, the syntax to test whether the blocks in two regions match is:
/testforblocks <begin> <end> <destination> [masked¦all]
Definitions
- begin is the starting x y z coordinate for the source region of blocks to compare (ie: first corner block).
- end is the ending x y z coordinate for the source region of blocks to compare (ie: opposite corner block).
- destination is the x y z 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.
- all is optional. It tells the command to compare all blocks in the source and destination region. All blocks must match exactly in the source and destination regions. This is the default behavior.
- masked is optional. It tells the command to exclude air blocks in the source region from being compared to the corresponding blocks in the destination region. All other blocks (non-air blocks) must match exactly in the source and destination regions.
TestForBlocks Command in Minecraft Nintendo Switch Edition
In Minecraft Nintendo Switch Edition, the syntax to test whether the blocks in two regions match is:
/testforblocks <begin> <end> <destination> [masked¦all]
Definitions
- begin is the starting x y z coordinate for the source region of blocks to compare (ie: first corner block).
- end is the ending x y z coordinate for the source region of blocks to compare (ie: opposite corner block).
- destination is the x y z 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.
- all is optional. It tells the command to compare all blocks in the source and destination region. All blocks must match exactly in the source and destination regions. This is the default behavior.
- masked is optional. It tells the command to exclude air blocks in the source region from being compared to the corresponding blocks in the destination region. All other blocks (non-air blocks) must match exactly in the source and destination regions.
TestForBlocks Command in Minecraft Windows 10 Edition
In Minecraft Windows 10 Edition, the syntax to test whether the blocks in two regions match is:
/testforblocks <begin> <end> <destination> [masked¦all]
Definitions
- begin is the starting x y z coordinate for the source region of blocks to compare (ie: first corner block).
- end is the ending x y z coordinate for the source region of blocks to compare (ie: opposite corner block).
- destination is the x y z 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.
- all is optional. It tells the command to compare all blocks in the source and destination region. All blocks must match exactly in the source and destination regions. This is the default behavior.
- masked is optional. It tells the command to exclude air blocks in the source region from being compared to the corresponding blocks in the destination region. All other blocks (non-air blocks) must match exactly in the source and destination regions.
TestForBlocks Command in Minecraft Education Edition
In Minecraft Education Edition, the syntax to test whether the blocks in two regions match is:
/testforblocks <begin> <end> <destination> [masked¦all]
Definitions
- begin is the starting x y z coordinate for the source region of blocks to compare (ie: first corner block).
- end is the ending x y z coordinate for the source region of blocks to compare (ie: opposite corner block).
- destination is the x y z 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.
- all is optional. It tells the command to compare all blocks in the source and destination region. All blocks must match exactly in the source and destination regions. This is the default behavior.
- masked is optional. It tells the command to exclude air blocks in the source region from being compared to the corresponding blocks in the destination region. All other blocks (non-air blocks) must match exactly in the source and destination regions.
- Java
- PE
- Xbox
- PS
- Nintendo
- Win10
- Edu
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
Example in Pocket Edition (PE)
To compare a source region from the starting coordinate (8, 65, 4) to the ending coordinate (2, 70, 4) against the destination coordinate (~ ~ ~):
/testforblocks 8 65 4 2 70 4 ~ ~ ~
To compare a source region from the starting coordinate (~2 ~-1 ~6) to the ending coordinate (~8 ~8 ~8) against the destination coordinate (~5 ~ ~-7) and ignoring air blocks in the source region:
/testforblocks ~2 ~-1 ~6 ~8 ~8 ~8 ~5 ~ ~-7 masked
To compare a source region from the starting coordinate (6, 62, 1) to the ending coordinate (4, 68, -5) against the destination coordinate (~3 ~3 ~3):
/testforblocks 6 62 1 4 68 -5 ~3 ~3 ~3
Example in Xbox One Edition
To compare a source region from the starting coordinate (10, 62, 4) to the ending coordinate (3, 67, 4) against the destination coordinate (~ ~ ~):
/testforblocks 10 62 4 3 67 4 ~ ~ ~
To compare a source region from the starting coordinate (~4 ~-1 ~6) to the ending coordinate (~10 ~8 ~8) against the destination coordinate (~2 ~ ~-4) and ignoring air blocks in the source region:
/testforblocks ~4 ~-1 ~6 ~10 ~8 ~8 ~2 ~ ~-4 masked
To compare a source region from the starting coordinate (5, 61, 0) to the ending coordinate (3, 67, -6) against the destination coordinate (~4 ~4 ~4):
/testforblocks 5 61 0 3 67 -6 ~4 ~4 ~4
Example in PS4 Edition
To compare a source region from the starting coordinate (9, 63, 5) to the ending coordinate (2, 68, 3) against the destination coordinate (~ ~ ~):
/testforblocks 9 63 5 2 68 3 ~ ~ ~
To compare a source region from the starting coordinate (~5 ~-2 ~5) to the ending coordinate (~11 ~7 ~7) against the destination coordinate (~3 ~ ~-2) and ignoring air blocks in the source region:
/testforblocks ~5 ~-2 ~5 ~11 ~7 ~7 ~3 ~ ~-2 masked
To compare a source region from the starting coordinate (6, 62, 1) to the ending coordinate (4, 68, -5) against the destination coordinate (~3 ~3 ~3):
/testforblocks 6 62 1 4 68 -5 ~3 ~3 ~3
Example in Nintendo Switch Edition
To compare a source region from the starting coordinate (9, 66, 5) to the ending coordinate (3, 71, 5) against the destination coordinate (~ ~ ~):
/testforblocks 9 66 5 3 71 5 ~ ~ ~
To compare a source region from the starting coordinate (~3 ~0 ~7) to the ending coordinate (~5 ~5 ~8) against the destination coordinate (~10 ~1 ~-4) and ignoring air blocks in the source region:
/testforblocks ~3 ~0 ~7 ~5 ~5 ~8 ~10 ~1 ~-4 masked
To compare a source region from the starting coordinate (3, 62, 1) to the ending coordinate (5, 68, -5) against the destination coordinate (~-1 ~-1 ~-1):
/testforblocks 3 62 1 5 68 -5 ~-1 ~-1 ~-1
Example in Windows 10 Edition
To compare a source region from the starting coordinate (~2 ~-1 ~6) to the ending coordinate (~8 ~8 ~8) against the destination coordinate (8, 65, 4):
/testforblocks ~2 ~-1 ~6 ~8 ~8 ~8 8 65 4
To compare a source region from the starting coordinate (5, 57, 3) to the ending coordinate (6, 59, -5) against the destination coordinate (~ ~ ~) and ignoring air blocks in the source region:
/testforblocks 5 57 3 6 59 -5 ~ ~ ~ replace masked
To compare a source region from the starting coordinate (4, 61, -3) to the ending coordinate (7, 65, 3) against the destination coordinate (~2 ~3 ~2):
/testforblocks 4 61 -3 7 65 3 ~2 ~3 ~2
Example in Minecraft Education Edition
To compare a source region from the starting coordinate (50, 65, 335) to the ending coordinate (44, 73, 335) against the destination coordinate (~3 ~ ~2):
/testforblocks 50 65 335 44 74 358 ~3 ~ ~2
To compare a source region from the starting coordinate (150, 74, 238) to the ending coordinate (142, 88, 224) against the destination coordinate (200, 80, 210) and ignoring air blocks in the source region:
/testforblocks 150 74 238 142 88 224 200 80 210 replace move
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 filtered normal bedrock
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:
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.
Congratulations, you have learned how to use the /testforblocks command in Minecraft.