News
Game
Guides
Downloads
Versions
/test
COMMANDS DEBUG & TESTS CHEATS · LEVEL 2 17 SUBCOMMANDS Added in 1.21.5

/test command in Minecraft

/test runs, creates and manages GameTests, automated tests built from a structure and test logic. Mojang uses this framework to check game mechanics, and data pack authors can use it to verify that their contraptions and functions still work.

Syntax

/test (clearall|clearthat|clearthese|create|locate|pos|resetclosest|resetthat|resetthese|run|runclosest|runfailed|runmultiple|runthat|runthese|stop|verify)
All 41 forms
  • /test clearall
  • /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
  • /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>
  • /test run <tests> <numberOfTimes> <untilFailed> <rotationSteps> <testsPerRow>
  • /test runclosest
  • /test runclosest <numberOfTimes>
  • /test runclosest <numberOfTimes> <untilFailed>
  • /test runfailed
  • /test runfailed <numberOfTimes>
  • /test runfailed <numberOfTimes> <untilFailed>
  • /test runfailed <numberOfTimes> <untilFailed> <rotationSteps>
  • /test runfailed <numberOfTimes> <untilFailed> <rotationSteps> <testsPerRow>
  • /test runfailed <onlyRequiredTests>
  • /test runfailed <onlyRequiredTests> <numberOfTimes>
  • /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed>
  • /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps>
  • /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps> <testsPerRow>
  • /test runmultiple <tests>
  • /test runmultiple <tests> <amount>
  • /test runthat
  • /test runthat <numberOfTimes>
  • /test runthat <numberOfTimes> <untilFailed>
  • /test runthese
  • /test runthese <numberOfTimes>
  • /test runthese <numberOfTimes> <untilFailed>
  • /test stop
  • /test verify <tests>
/test clearall
/test clearall [<radius>]
ArgumentExpectsWhat it does
radiusoptionalWhole numberDistance in blocks around you within which test structures are removed.
All 2 forms
  • /test clearall
  • /test clearall <radius>
/test clearthat
/test clearthat
/test clearthese
/test clearthese
/test create
/test create <id> [<width> [<height> <depth>]]
ArgumentExpectsWhat it does
idResource IDID of the new test, such as blockaria:door_test, in your own namespace.
widthoptionalWhole numberWidth of the test area, in blocks.
heightoptionalWhole numberHeight of the test area, in blocks, given together with depth.
depthoptionalWhole numberDepth of the test area, in blocks, given together with height.
All 3 forms
  • /test create <id>
  • /test create <id> <width>
  • /test create <id> <width> <height> <depth>
/test locate
/test locate <tests>
ArgumentExpectsWhat it does
testsIDs (wildcards) · test_instanceTests to target: an ID like minecraft:always_pass, or a pattern matching several tests.
/test pos
/test pos [<var>]
ArgumentExpectsWhat it does
varoptionalTextone wordOptional name used for the position in the result printed in chat.
All 2 forms
  • /test pos
  • /test pos <var>
/test resetclosest
/test resetclosest
/test resetthat
/test resetthat
/test resetthese
/test resetthese
/test run
/test run <tests> [<numberOfTimes> [<untilFailed> [<rotationSteps> [<testsPerRow>]]]]
ArgumentExpectsWhat it does
testsIDs (wildcards) · test_instanceTests to target: an ID like minecraft:always_pass, or a pattern matching several tests.
numberOfTimesoptionalWhole numberat least 0How many times each test runs, 0 or more.
untilFailedoptionaltrue / falsetrue stops the repetitions as soon as a test fails.
rotationStepsoptionalWhole numberNumber of quarter turns applied to the test structure before it runs.
testsPerRowoptionalWhole numberHow many tests are placed side by side in each row.
All 5 forms
  • /test run <tests>
  • /test run <tests> <numberOfTimes>
  • /test run <tests> <numberOfTimes> <untilFailed>
  • /test run <tests> <numberOfTimes> <untilFailed> <rotationSteps>
  • /test run <tests> <numberOfTimes> <untilFailed> <rotationSteps> <testsPerRow>
/test runclosest
/test runclosest [<numberOfTimes> [<untilFailed>]]
ArgumentExpectsWhat it does
numberOfTimesoptionalWhole numberat least 0How many times each test runs, 0 or more.
untilFailedoptionaltrue / falsetrue stops the repetitions as soon as a test fails.
All 3 forms
  • /test runclosest
  • /test runclosest <numberOfTimes>
  • /test runclosest <numberOfTimes> <untilFailed>
/test runfailed
/test runfailed [<numberOfTimes>|<onlyRequiredTests>]
ArgumentExpectsWhat it does
numberOfTimesoptionalWhole numberat least 0How many times each test runs, 0 or more.
untilFailedoptionaltrue / falsetrue stops the repetitions as soon as a test fails.
rotationStepsoptionalWhole numberNumber of quarter turns applied to the test structure before it runs.
testsPerRowoptionalWhole numberHow many tests are placed side by side in each row.
onlyRequiredTestsoptionaltrue / falsetrue runs again only the failed tests that are marked as required.
All 10 forms
  • /test runfailed
  • /test runfailed <numberOfTimes>
  • /test runfailed <numberOfTimes> <untilFailed>
  • /test runfailed <numberOfTimes> <untilFailed> <rotationSteps>
  • /test runfailed <numberOfTimes> <untilFailed> <rotationSteps> <testsPerRow>
  • /test runfailed <onlyRequiredTests>
  • /test runfailed <onlyRequiredTests> <numberOfTimes>
  • /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed>
  • /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps>
  • /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps> <testsPerRow>
/test runmultiple
/test runmultiple <tests> [<amount>]
ArgumentExpectsWhat it does
testsIDs (wildcards) · test_instanceTests to target: an ID like minecraft:always_pass, or a pattern matching several tests.
amountoptionalWhole numberNumber of copies of the selected tests to run in this batch.
All 2 forms
  • /test runmultiple <tests>
  • /test runmultiple <tests> <amount>
/test runthat
/test runthat [<numberOfTimes> [<untilFailed>]]
ArgumentExpectsWhat it does
numberOfTimesoptionalWhole numberat least 0How many times each test runs, 0 or more.
untilFailedoptionaltrue / falsetrue stops the repetitions as soon as a test fails.
All 3 forms
  • /test runthat
  • /test runthat <numberOfTimes>
  • /test runthat <numberOfTimes> <untilFailed>
/test runthese
/test runthese [<numberOfTimes> [<untilFailed>]]
ArgumentExpectsWhat it does
numberOfTimesoptionalWhole numberat least 0How many times each test runs, 0 or more.
untilFailedoptionaltrue / falsetrue stops the repetitions as soon as a test fails.
All 3 forms
  • /test runthese
  • /test runthese <numberOfTimes>
  • /test runthese <numberOfTimes> <untilFailed>
/test stop
/test stop
/test verify
/test verify <tests>
ArgumentExpectsWhat it does
testsIDs (wildcards) · test_instanceTests to target: an ID like minecraft:always_pass, or a pattern matching several tests.

Examples

Run the example test

/test run minecraft:always_pass

Runs the only test of the base game and reports the result in chat.

Java 26.3

Run the nearest test

/test runclosest

Runs the test closest to you, handy while building one.

Java 26.3

Create a new test

/test create blockaria:door_test 5

Sets up a new test named blockaria:door_test with a size of 5.

Java 26.3
Build your command

Fill in the fields, then copy the command.

Command generator

Tests and test instances

A test is a test_instance entry in a data pack: it names a structure, an environment and a type, function or block_based. The game ships a single example, minecraft:always_pass. In the world, each test is handled by a Test Instance Block. Install your test packs with /datapack.

Running and cleaning

test run takes one or more tests, runclosest runs the nearest one and runfailed repeats failures. The chat ends with Game Test complete! and the number of tests run. clearall removes test structures around you, and locate finds where tests are placed.

✓ Checked in Java Edition 26.3 · updated 2 November 2026

/test: FAQ

Which tests exist in the base game?

Only minecraft:always_pass, an example that passes right away. Other tests come from data packs or mods.

How do I repeat only the tests that failed?

Run /test runfailed. With true as the first value, only failed tests marked as required are run again.

How do I use /test?

Type it in the chat with cheats on: /test clearall [<radius>].

Who can use /test?

Cheats on, or operator level 2.

Since when does /test exist?

It is in the official command tree since Java Edition 1.21.5.

Related commands