Annotation Interface GameTest
GameTest
is an annotation that can be used to mark a method as a game test.
GameTest
methods must be public
not static
, return void
and take exactly one argument of type TestContext
.
The values in this class directly correspond to the values in TestData
.
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionA namespaced ID of an entry within theRegistryKeys.TEST_ENVIRONMENT
registry.boolean
When set the test must be ran manually.int
The number of times the test should be re attempted if it fails.int
The maximum number of ticks the test is allowed to run for.boolean
Whether the test is required to pass for the test suite to pass.int
The number of times the test should be successfully ran before it is considered a success.The rotation of the structure when placed.int
The number of ticks to wait before starting the test after placing the structure.boolean
Whether the test should have sky access.A namespaced ID pointing to a structure resource in themodid/gametest/structure/
directory.
-
Element Details
-
environment
String environmentA namespaced ID of an entry within theRegistryKeys.TEST_ENVIRONMENT
registry.- Default:
"minecraft:default"
-
structure
String structureA namespaced ID pointing to a structure resource in themodid/gametest/structure/
directory.Defaults to an 8x8 structure with no blocks.
- Default:
"fabric-gametest-api-v1:empty"
-
maxTicks
int maxTicksThe maximum number of ticks the test is allowed to run for.- Default:
20
-
setupTicks
int setupTicksThe number of ticks to wait before starting the test after placing the structure.- Default:
0
-
required
boolean requiredWhether the test is required to pass for the test suite to pass.- Default:
true
-
rotation
BlockRotation rotationThe rotation of the structure when placed.- Default:
NONE
-
manualOnly
boolean manualOnlyWhen set the test must be ran manually.- Default:
false
-
maxAttempts
int maxAttemptsThe number of times the test should be re attempted if it fails.- Default:
1
-
requiredSuccesses
int requiredSuccessesThe number of times the test should be successfully ran before it is considered a success.- Default:
1
-
skyAccess
boolean skyAccessWhether the test should have sky access. Whenfalse
the test will be enclosed by barrier blocks.- Default:
false
-