Test instance

Helpers that build a minecraft:test_instance object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. Click a type to see what it accepts.

BlockBased

BlockBased
BlockBased(environment, structure, max_ticks, dimension?, setup_ticks?, required?, rotation?, manual_only?, max_attempts?, required_successes?, sky_access?, padding?)
environment
test_environment id | TestEnvironment

The test environment to run this test as part of.

structure
structure id

Structure NBT file to use for the test.

max_ticks
int 1..

Maximum number of ticks allowed to pass before the test is considered timed out.

dimensionoptional
dimension id

Defaults to overworld.

setup_ticksoptional
int 0..

Ticks to wait after placing the structure before starting the test. Defaults to 0.

requiredoptional
bool

Whether the test is considered required to pass for the full test suite to pass. Defaults to true.

rotationoptional
Rotation

Rotation to apply to the test structure. Defaults to none.

manual_onlyoptional
bool

If true, test is not included as part of automated test runs. Defaults to false.

max_attemptsoptional
int 1..

Number of attempts to run the test. Defaults to 1.

required_successesoptional
int 1..

Number of attempts that must succeed for the test to be considered successful. Defaults to 1.

sky_accessoptional
bool

Whether the test needs clear access to the sky. Defaults to false. If false, test is enclosed in barrier blocks. If true, the top is left open.

paddingoptional
int 0..128

Additional padding in blocks placed around the structure. Defaults to 0.

Function

Function
Function(environment, structure, max_ticks, function, dimension?, setup_ticks?, required?, rotation?, manual_only?, max_attempts?, required_successes?, sky_access?, padding?)
environment
test_environment id | TestEnvironment

The test environment to run this test as part of.

structure
structure id

Structure NBT file to use for the test.

max_ticks
int 1..

Maximum number of ticks allowed to pass before the test is considered timed out.

function
test_function id

Test function (Java code) to run.

dimensionoptional
dimension id

Defaults to overworld.

setup_ticksoptional
int 0..

Ticks to wait after placing the structure before starting the test. Defaults to 0.

requiredoptional
bool

Whether the test is considered required to pass for the full test suite to pass. Defaults to true.

rotationoptional
Rotation

Rotation to apply to the test structure. Defaults to none.

manual_onlyoptional
bool

If true, test is not included as part of automated test runs. Defaults to false.

max_attemptsoptional
int 1..

Number of attempts to run the test. Defaults to 1.

required_successesoptional
int 1..

Number of attempts that must succeed for the test to be considered successful. Defaults to 1.

sky_accessoptional
bool

Whether the test needs clear access to the sky. Defaults to false. If false, test is enclosed in barrier blocks. If true, the top is left open.

paddingoptional
int 0..128

Additional padding in blocks placed around the structure. Defaults to 0.