Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/test

Command

/test

Creates, finds, runs, resets and clears game tests, the automated test structures used by developers and data pack makers.

Syntax

/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>]

Arguments

ArgumentKind of valueWhat to type
<radius>Whole numberFor clearall, the distance in blocks to search for tests. Default 250; values are limited to 0 through 1024.
<id>IdFor create, the id of the new test, such as mypack:door_test.
<width>Whole numberFor 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 numberFor create, the size of the test along Y in blocks. Maximum 48.
<depth>Whole numberFor create, the size of the test along Z in blocks. Maximum 48.
<tests>Id patternWhich 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>TextFor 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 numberHow many times each test is run. Minimum 0; 0 repeats without a limit. At least 0.
<untilFailed>True or falsetrue or false. With true, a repeated test stops repeating as soon as it fails.
<rotationSteps>Whole numberHow many quarter turns to rotate the test structure before running it.
<testsPerRow>Whole numberHow many test structures are placed in one row. Default: 8.
<onlyRequiredTests>True or falsetrue or false. With true, runfailed runs only the failed tests that are marked as required.
<amount>Whole numberFor runmultiple, how many copies of each selected test to run.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inServer 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.
ResultRun 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, runthatRun 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, resetthatPut 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, clearallRemove 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 testsThe base game ships one test, minecraft:always_pass. Other tests come from data packs.

Examples

/test run minecraft:always_pass

Places the test minecraft:always_pass near you and runs it once.

/test runthese

Runs every test structure within 250 blocks.

/test clearall

Removes every test structure within 250 blocks.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)