
Command
/test
Creates, finds, runs, resets and clears game tests, the automated test structures used by developers and data pack makers.
| /test clearall [<radius>] |
| /test (clearthat|clearthese|resetclosest|resetthat|resetthese|stop) |
| /test create <id> [<width> [<height> <depth>]] |
| /test (locate <tests>|verify <tests>) |
| /test pos [<var>] |
| /test run <tests> [<numberOfTimes> [<untilFailed> [<rotationSteps> [<testsPerRow>]]]] |
| /test (runclosest|runthat|runthese) [<numberOfTimes> [<untilFailed>]] |
| /test runfailed |
| /test runfailed <numberOfTimes> [<untilFailed> [<rotationSteps> [<testsPerRow>]]] |
| /test runfailed <onlyRequiredTests> [<numberOfTimes> [<untilFailed> [<rotationSteps> [<testsPerRow>]]]] |
| /test runmultiple <tests> [<amount>] |
| Argument | Kind of value | What to type |
|---|---|---|
| <radius> | Whole number | For clearall, the distance in blocks to search for tests. Default 250; values are limited to 0 through 1024. |
| <id> | Id | For create, the id of the new test, such as mypack:door_test. |
| <width> | Whole number | For create, the size of the test along X in blocks. Used for all three sides if height and depth are left out. Maximum 48. |
| <height> | Whole number | For create, the size of the test along Y in blocks. Maximum 48. |
| <depth> | Whole number | For create, the size of the test along Z in blocks. Maximum 48. |
| <tests> | Id pattern | Which tests to use: a test id such as minecraft:always_pass, or a pattern with * (any text) and ? (any one character), such as minecraft:*. Without a namespace, minecraft is assumed. At least one test must match. The id of a test instance. |
| <var> | Text | For pos, the variable name used in the line that is copied to the clipboard. A single word. Default: pos. One word without spaces. |
| <numberOfTimes> | Whole number | How many times each test is run. Minimum 0; 0 repeats without a limit. At least 0. |
| <untilFailed> | True or false | true or false. With true, a repeated test stops repeating as soon as it fails. |
| <rotationSteps> | Whole number | How many quarter turns to rotate the test structure before running it. |
| <testsPerRow> | Whole number | How many test structures are placed in one row. Default: 8. |
| <onlyRequiredTests> | True or false | true or false. With true, runfailed runs only the failed tests that are marked as required. |
| <amount> | Whole number | For runmultiple, how many copies of each selected test to run. |
| Permission level | 2: operators, worlds with cheats on, command blocks and functions |
| Works in | Server operators, players in a singleplayer or LAN world with cheats enabled, the server console, command blocks and functions. /test pos must be run by a player. |
| Result | Run commands report "Running N test(s)..." followed by a summary of passed and failed tests when they finish, and return 1 once the tests start (0 with "No tests to run" if none were found). locate, the reset commands and the clear commands return the number of test structures found, reset or cleared. create, pos and stop return 1. |
| run | /test run <tests> [numberOfTimes] [untilFailed] [rotationSteps] [testsPerRow] places the selected tests near you and runs them. By default each test runs once and the tests are laid out 8 per row. |
| runmultiple | /test runmultiple <tests> [amount] runs the selected tests, with amount copies of each one. |
| runclosest, runthese, runthat | Run tests that already stand in the world: runclosest the nearest test within 15 blocks, runthese every test within 250 blocks, runthat the test you are looking at. Each accepts [numberOfTimes] [untilFailed]. |
| runfailed | /test runfailed [onlyRequiredTests] [numberOfTimes] [untilFailed] [rotationSteps] [testsPerRow] runs again the tests that failed in the last run. With onlyRequiredTests set to true, optional tests are skipped. |
| verify | /test verify <tests> runs each selected test 100 times in each of the 4 rotations and stops at the first failure. |
| locate | /test locate <tests> searches for the test blocks of the selected tests within 250 blocks in every dimension and lists their positions with the distance. Fails with "Found no test instances" if there are none. |
| resetclosest, resetthese, resetthat | Put a test structure back to its starting state: the nearest test within 15 blocks, every test within 250 blocks, or the test you are looking at. |
| clearthat, clearthese, clearall | Remove test structures and their test blocks: the test you are looking at, every test within 250 blocks, or with /test clearall [radius] every test within the radius. The radius defaults to 250 and is limited to 0 through 1024. |
| create | /test create <id> [width] [height depth] creates an empty test with a Bedrock floor near you. The default size is 5 by 5 by 5. A width alone gives a cube of that size. Fails if any side is larger than 48 blocks. |
| pos | /test pos [var] shows the position of the block you are looking at (up to 10 blocks away) relative to the test that contains it. Clicking the result copies it as a line of code that uses the given variable name, pos by default. |
| stop | /test stop stops all running tests. Starting a new run, a reset or a clear also stops the tests that are running. |
| Available tests | The base game ships one test, minecraft:always_pass. Other tests come from data packs. |
/test run minecraft:always_passPlaces the test minecraft:always_pass near you and runs it once.
/test runtheseRuns every test structure within 250 blocks.
/test clearallRemoves every test structure within 250 blocks.



