Test instance definition
Jump to navigation
Jump to search
This feature is exclusive to Java Edition.
A test instance represents a test that can be run by the GameTest framework.
Definition
[edit | edit source]Test instances can be defined in data packs, as part of the directory structure below.
data pack name.zip or
data pack name
pack.mcmeta
data
namespace
test_instance
<name>.json
- More directories…
JSON Format
[edit | edit source]Test instances are defined using the following format:
- [NBT Compound / JSON Object] The root object.
- [NBT Compound / JSON Object][String] environment One test environment (an [String] ID, or a new [NBT Compound / JSON Object] test environment definition) — The environment of this test.
- [String] structure Resource location of the structure to use for the test.
- [Int] max_ticks A positive integer representing the maximum number of ticks allowed to pass before the test is considered timed out.
- [Int] setup_ticks: Represents a number of ticks to wait after placing the structure before starting the test. Must be a non-negative integer. Default to
0. - [Boolean] required: Whether the test is considered required to pass for the full test suite to pass. Defaults to
true. - [String] rotation Optional rotation to apply to the test structure. Must be one of
none(default),clockwise_90,180andcounterclockwise_90. - [Boolean] manual_only Set to
truefor tests that are not included as part of automated test runs. Defaults tofalse. - [Boolean] sky_access Whether the test needs clear access to the sky. Tests are enclosed in barrier blocks. If set to
true, the top is left open. Defaults tofalse. - [Int] max_attempts: Number of attempts to run the test. Default to
1. - [Int] required_successes Number of attempts that must succeed for the test to be considered successful. Defaults to
1. - [String] type: The type of test. Must be one of
block_basedandfunction. See GameTest#Test instance for more information.
History
[edit | edit source]| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.21.5 | 25w03a | Added test instance definition to data packs. | |||||
| 25w04a | Renamed field batch to environment, and sky_accesss to sky_access | ||||||