Annotation Interface GameTest


@Retention(RUNTIME) @Target(METHOD) @Documented public @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 Link icon

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    A namespaced ID of an entry within the RegistryKeys.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 the modid/gametest/structure/ directory.
  • Element Details

    • environment Link icon

      String environment
      A namespaced ID of an entry within the RegistryKeys.TEST_ENVIRONMENT registry.
      Default:
      "minecraft:default"
    • structure Link icon

      String structure
      A namespaced ID pointing to a structure resource in the modid/gametest/structure/ directory.

      Defaults to an 8x8 structure with no blocks.

      Default:
      "fabric-gametest-api-v1:empty"
    • maxTicks Link icon

      int maxTicks
      The maximum number of ticks the test is allowed to run for.
      Default:
      20
    • setupTicks Link icon

      int setupTicks
      The number of ticks to wait before starting the test after placing the structure.
      Default:
      0
    • required Link icon

      boolean required
      Whether the test is required to pass for the test suite to pass.
      Default:
      true
    • rotation Link icon

      BlockRotation rotation
      The rotation of the structure when placed.
      Default:
      NONE
    • manualOnly Link icon

      boolean manualOnly
      When set the test must be ran manually.
      Default:
      false
    • maxAttempts Link icon

      int maxAttempts
      The number of times the test should be re attempted if it fails.
      Default:
      1
    • requiredSuccesses Link icon

      int requiredSuccesses
      The number of times the test should be successfully ran before it is considered a success.
      Default:
      1
    • skyAccess Link icon

      boolean skyAccess
      Whether the test should have sky access. When false the test will be enclosed by barrier blocks.
      Default:
      false