Annotation Interface GameTest
Marks a method as a game test, for
GameTests.register(String, Class). The method takes the test's
GameTestHelper and returns nothing; it may be static, or belong to an instance of its class made with the
class's no-argument constructor. Each test is named <modid>:<class>/<method>, in snake case
(mymod:wand_tests/zaps_a_zombie), or <modid>:<class>/<name> with name().
public final class WandTests {
@GameTest
public static void zapsAZombie(GameTestHelper helper) {
Zombie zombie = helper.spawn(EntityType.ZOMBIE, 2, 1, 2);
...
helper.succeedWhen(() -> helper.assertEntityNotPresent(EntityType.ZOMBIE));
}
}
Each element is one of GameTestOptions'; see there for what it does.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanintintThe test's name instead of the method's (in snake case either way).intbooleanintintQuarter turns clockwise, 0 to 3.intbooleanThe structure the test runs in, as an id; empty forGameTestOptions.PLATFORM.
-
Element Details
-
name
String nameThe test's name instead of the method's (in snake case either way).- Default:
- ""
-
structure
String structureThe structure the test runs in, as an id; empty forGameTestOptions.PLATFORM.- Default:
- ""
-
maxTicks
int maxTicks- Default:
- 100
-
setupTicks
int setupTicks- Default:
- 0
-
required
boolean required- Default:
- true
-
rotation
int rotationQuarter turns clockwise, 0 to 3.- Default:
- 0
-
manualOnly
boolean manualOnly- Default:
- false
-
maxAttempts
int maxAttempts- Default:
- 1
-
requiredSuccesses
int requiredSuccesses- Default:
- 1
-
skyAccess
boolean skyAccess- Default:
- false
-
padding
int padding- Default:
- 0
-