Annotation Interface GameTest


@Retention(RUNTIME) @Target(METHOD) public @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.
  • Element Details

    • name

      String name
      The test's name instead of the method's (in snake case either way).
      Default:
      ""
    • structure

      String structure
      The structure the test runs in, as an id; empty for GameTestOptions.PLATFORM.
      Default:
      ""
    • maxTicks

      int maxTicks
      Default:
      100
    • setupTicks

      int setupTicks
      Default:
      0
    • required

      boolean required
      Default:
      true
    • rotation

      int rotation
      Quarter 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