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

    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 run 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

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

      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

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

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

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

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

      boolean manualOnly
      When set the test must be run manually.
      Default:
      false
    • maxAttempts

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

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

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