Interface GameModule<P,L,W,M,I,S,B,E,Ls,Pr>


public interface GameModule<P,L,W,M,I,S,B,E,Ls,Pr>
Main interface implemented by all game modules. Module metadata is loaded from module.yml automatically.
  • Method Details

    • onLoad

      void onLoad()
      Called when module is loaded (once, on server start). Use this to: - Register game in vote menu - Initialize static resources Configuration is OPTIONAL - access via getModuleConfig() if needed.
    • onStart

      void onStart(GameContext<P,L,W,M,I,S,B,E> context)
      Called when a game starts in an arena. Use this to initialize game-specific logic.
      Parameters:
      context - Game context with all APIs
    • onEnd

      void onEnd(GameContext<P,L,W,M,I,S,B,E> context, GameResult<P> result)
      Called when a game ends.
      Parameters:
      context - Game context
      result - Game result with winner and players
    • onDisable

      void onDisable()
      Called when module is unloaded (server shutdown/reload).
    • registerEvents

      void registerEvents(CustomEventRegistry<Ls,Pr> registry)
    • onGameStart

      default void onGameStart(GameContext<P,L,W,M,I,S,B,E> context)
      Called after countdown finishes and game starts.
    • onGameTick

      default void onGameTick(GameContext<P,L,W,M,I,S,B,E> context, int secondsRemaining)
    • onPlayerEliminate

      default void onPlayerEliminate(GameContext<P,L,W,M,I,S,B,E> context, P player, String reason)
    • onPlayerRespawn

      default void onPlayerRespawn(GameContext<P,L,W,M,I,S,B,E> context, P player)
    • getCustomPlaceholders

      default Map<String,String> getCustomPlaceholders(P player)
    • onCountdownTick

      default void onCountdownTick(GameContext<P,L,W,M,I,S,B,E> context, int secondsLeft)
      Called every tick during countdown phase. Use this to send countdown titles/sounds.
      Parameters:
      context - Game context
      secondsLeft - Seconds remaining in countdown
    • onCountdownFinish

      default void onCountdownFinish(GameContext<P,L,W,M,I,S,B,E> context)
      Called when countdown finishes, just before game starts. Use this to send "GO!" title or final preparation.
      Parameters:
      context - Game context
    • freezePlayersOnCountdown

      default boolean freezePlayersOnCountdown()
      Should players be frozen during countdown? If true, players cannot move during countdown phase.
      Returns:
      true to freeze players, false to allow movement
    • getDisabledRequirements

      default Set<SetupRequirement> getDisabledRequirements()
      Returns the set of default setup requirements that this module explicitly disables. Requirements not present in the returned set remain enforced as usual (backward-compatible default).

      When a requirement is disabled:

      • Setup flows will skip prompts for that requirement.
      • Minigame enable/boot validation will skip checks for that requirement.
      Override this method to opt out of one or more default requirements.

      Returns:
      an unmodifiable set of disabled requirements, empty by default
      Since:
      3.2
    • allowJoinInProgress

      default boolean allowJoinInProgress()
      Declares whether players may join an in-progress match in standalone mode.

      Defaults to false (joining after start is not allowed). Even if this returns true, the core will never allow join-in-progress in party mode.

      Returns:
      true to allow join-in-progress in standalone mode
      Since:
      3.2
    • onPlayerJoinInProgress

      default boolean onPlayerJoinInProgress(GameContext<P,L,W,M,I,S,B,E> context, P player)
      Called when a player joins an already-running match, right after the core has registered them in this game's GameContext.

      Only invoked when allowJoinInProgress() returned true for the arena. The module is responsible for actually placing the player into the match (team assignment, teleporting them into the game world, equipping their loadout, etc.) — the core does not do this on its behalf, since it is entirely game-specific.

      Return false to reject the join-in-progress attempt (e.g. every team is already full). When rejected, the core undoes the registration and notifies the player instead of leaving them stuck in a half-joined state. The default implementation always rejects, since a module that never overrides this method has no way to actually place the player into the match.

      Parameters:
      context - Game context with all APIs
      player - the player joining the running match
      Returns:
      true if the player was placed into the match successfully
      Since:
      3.4
    • getDisplayName

      default String getDisplayName()
      Returns a human-readable display name for this module. The default implementation returns null, which signals the core to fall back to the module descriptor name or language.yml lookup. Override this to expose the display name from your own config (e.g. language.yml).
      Returns:
      display name, or null to use the descriptor fallback
      Since:
      3.3
    • getSetupMetadata

      default ModuleSetupMetadata getSetupMetadata()
      Returns optional declarative install/setup metadata for this module.

      Metadata is used by the core to enrich admin help, setup status checklists, and diagnostics. It does not replace setup command handlers or validation. Existing modules can ignore this method and will keep working unchanged.

      Returns:
      setup metadata, empty by default
      Since:
      3.4
    • requiresSpawnCapacityValidation

      default boolean requiresSpawnCapacityValidation()
      Returns whether the core should require enough configured spawn points for this module before the game can be enabled.

      Returning false keeps core spawn setup commands available, but disables only the numeric one-spawn-per-player capacity check. Use getDisabledRequirements() with SetupRequirement.SPAWNS when the module does not use the core spawn requirement at all.

      Returns:
      true by default for backward-compatible validation
      Since:
      3.4