/test Command in Minecraft Java Edition

Create, Run, and Manage Game Tests

Java EditionDebug & DeveloperPermission: Level 2Added in 1.21.5

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.

Syntax (Java 26.3, 32 forms)

  1. /test clearall [<radius>]
  2. /test clearthat
  3. /test clearthese
  4. /test create <id>
  5. /test create <id> <width>
  6. /test create <id> <width> <height> <depth>
  7. /test locate <tests>
  8. /test pos [<var>]
  9. /test resetclosest
  10. /test resetthat
  11. /test resetthese
  12. /test run <tests>
  13. /test run <tests> <numberOfTimes>
  14. /test run <tests> <numberOfTimes> <untilFailed>
  15. /test run <tests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]
  16. /test runclosest
  17. /test runclosest <numberOfTimes> [<untilFailed>]
  18. /test runfailed
  19. /test runfailed <numberOfTimes>
  20. /test runfailed <numberOfTimes> <untilFailed>
  21. /test runfailed <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]
  22. /test runfailed <onlyRequiredTests>
  23. /test runfailed <onlyRequiredTests> <numberOfTimes>
  24. /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed>
  25. /test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]
  26. /test runmultiple <tests> [<amount>]
  27. /test runthat
  28. /test runthat <numberOfTimes> [<untilFailed>]
  29. /test runthese
  30. /test runthese <numberOfTimes> [<untilFailed>]
  31. /test stop
  32. /test verify <tests>

The forms you will use most

/test create <id> <width> <height> <depth>
Creates a new test with the given resource ID and specific width, height, and depth dimensions.
/test run <tests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]
Runs matching test instances a set number of times with options for stopping on failure, rotation steps, and row layout.
/test runclosest <numberOfTimes> [<untilFailed>]
Runs the closest test a specified number of times and optionally stops if it fails.
/test runfailed <onlyRequiredTests> <numberOfTimes> <untilFailed> <rotationSteps> [<testsPerRow>]
Re-runs previously failed tests with controls for required tests only, repetition count, rotation, and row size.
/test runmultiple <tests> [<amount>]
Runs multiple instances of the matching test pattern at the same time.
/test clearall [<radius>]
Clears all tests within an optional radius around you.
/test locate <tests>
Locates test instances that match the given entry pattern.
/test stop
Stops any tests that are currently running.

Arguments

ArgumentTypeWhat it means
<radius>whole numberA whole number that sets the distance around you for clearing tests.
<id>resource IDA namespaced resource ID for the test you are creating.
<width>whole numberA whole number that sets the width of the created test area.
<height>whole numberA whole number that sets the height of the created test area.
<depth>whole numberA 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>textA 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 / falseA true or false value that determines whether repeating tests should stop as soon as a failure occurs.
<rotationSteps>whole numberA whole number specifying the rotation steps applied when running tests.
<testsPerRow>whole numberA whole number that controls how many tests are placed in each row.
<onlyRequiredTests>true / falseA true or false value that filters failed test runs to include only required tests.
<amount>whole numberA whole number that sets how many copies to run when using the runmultiple subcommand.

Examples

Version history

Measured from the game files of every Java release from 1.13 to 26.3.

  1. 1.21.5 Command added.

Tips

Common mistakes

Java vs Bedrock

The /test command is only available in Minecraft Java Edition. Bedrock Edition does not have a command with this name.

FAQ

When was the /test command added to Minecraft?

The /test command was added to Minecraft Java Edition in version 1.21.5.

What permission level is needed to use /test?

You need permission level 2, which means you must be an operator on a multiplayer server or have cheats turned on in single-player.

How do I clear tests from my world?

You can remove tests by running /test clearthat, /test clearthese, or /test clearall [] to wipe all tests within a specific distance.

Related commands

/compute/debug/help/jfr/perf/stopwatch/tick/version