Create, Run, and Manage Game Tests
The /test command in Minecraft Java Edition lets operators create, run, locate, reset, and clear test instances in their world. It provides subcommands for controlling individual tests or groups of tests at once.
Players and creators use this command when setting up automated checks, verifying mechanics, or cleaning up test areas. You must have level 2 operator permissions (or cheats enabled in single-player) to use it.
/test clearall [<radius>]/test clearthat/test clearthese/test create <id>/test create <id> <width>/test create <id> <width> <height> <depth>/test locate <tests>/test pos [<var>]/test resetclosest/test resetthat/test resetthese/test run <tests>/test run <tests> <numberOfTimes>/test run <tests> <numberOfTimes> <untilFailed>/test run <tests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]/test runclosest/test runclosest <numberOfTimes> [<untilFailed>]/test runfailed/test runfailed <numberOfTimes>/test runfailed <numberOfTimes> <untilFailed>/test runfailed <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]/test runfailed <onlyRequiredTests>/test runfailed <onlyRequiredTests> <numberOfTimes>/test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed>/test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]/test runmultiple <tests> [<amount>]/test runthat/test runthat <numberOfTimes> [<untilFailed>]/test runthese/test runthese <numberOfTimes> [<untilFailed>]/test stop/test verify <tests>/test create <id> <width> <height> <depth>/test run <tests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]/test runclosest <numberOfTimes> [<untilFailed>]/test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]/test runmultiple <tests> [<amount>]/test clearall [<radius>]/test locate <tests>/test stop| Argument | Type | What it means |
|---|---|---|
<radius> | whole number | A whole number that sets the distance around you for clearing tests. |
<id> | resource ID | A namespaced resource ID for the test you are creating. |
<width> | whole number | A whole number that sets the width of the created test area. |
<height> | whole number | A whole number that sets the height of the created test area. |
<depth> | whole number | A whole number that sets the depth of the created test area. |
<tests> | entry pattern test instance | An entry pattern that matches test instance registry entries. |
<var> | text | A word or piece of text used with the position subcommand. |
<numberOfTimes> | whole number at least 0 | A whole number (at least 0) that specifies how many times to repeat the test. |
<untilFailed> | true / false | A true or false value that determines whether repeating tests should stop as soon as a failure occurs. |
<rotationSteps> | whole number | A whole number specifying the rotation steps applied when running tests. |
<testsPerRow> | whole number | A whole number that controls how many tests are placed in each row. |
<onlyRequiredTests> | true / false | A true or false value that filters failed test runs to include only required tests. |
<amount> | whole number | A whole number that sets how many copies to run when using the runmultiple subcommand. |
/test create custom:redstone_door 5 6 4Creates a new test named custom:redstone_door that is 5 blocks wide, 6 blocks high, and 4 blocks deep.
/test run custom:piston_pushRuns the test instance matching custom:piston_push once.
/test run custom:hopper_sort 10 true 2 4Runs the custom:hopper_sort test up to 10 times until it fails, using 2 rotation steps and placing 4 tests per row.
/test runmultiple custom:minecart_track 8Runs 8 instances of the custom:minecart_track test.
/test runclosest 3 falseRuns the nearest test 3 times without stopping early if a failure happens.
/test runfailed true 5 falseRe-runs only the required tests that previously failed, repeating them 5 times.
/test locate custom:water_flowFinds the location of test instances matching the custom:water_flow pattern.
/test clearall 50Clears all tests within a 50-block radius.
/test pos targetPosRuns the position subcommand using the text variable targetPos.
Measured from the game files of every Java release from 1.13 to 26.3.
The /test command is only available in Minecraft Java Edition. Bedrock Edition does not have a command with this name.
The /test command was added to Minecraft Java Edition in version 1.21.5.
You need permission level 2, which means you must be an operator on a multiplayer server or have cheats turned on in single-player.
You can remove tests by running /test clearthat, /test clearthese, or /test clearall [ to wipe all tests within a specific distance.