Interface GameModule<P,L,W,M,I,S,B,E,Ls,Pr>
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanDeclares whether players may join an in-progress match in standalone mode.default booleanShould players be frozen during countdown? If true, players cannot move during countdown phase.getCustomPlaceholders(P player) default Set<SetupRequirement> Returns the set of default setup requirements that this module explicitly disables.default StringReturns a human-readable display name for this module.default ModuleSetupMetadataReturns optional declarative install/setup metadata for this module.default voidonCountdownFinish(GameContext<P, L, W, M, I, S, B, E> context) Called when countdown finishes, just before game starts.default voidonCountdownTick(GameContext<P, L, W, M, I, S, B, E> context, int secondsLeft) Called every tick during countdown phase.voidCalled when module is unloaded (server shutdown/reload).voidCalled when a game ends.default voidonGameStart(GameContext<P, L, W, M, I, S, B, E> context) Called after countdown finishes and game starts.default voidonGameTick(GameContext<P, L, W, M, I, S, B, E> context, int secondsRemaining) voidonLoad()Called when module is loaded (once, on server start).default voiddefault booleanCalled when a player joins an already-running match, right after the core has registered them in this game'sGameContext.default voidvoidCalled when a game starts in an arena.voidregisterEvents(CustomEventRegistry<Ls, Pr> registry) default booleanReturns whether the core should require enough configured spawn points for this module before the game can be enabled.
-
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
Called when a game starts in an arena. Use this to initialize game-specific logic.- Parameters:
context- Game context with all APIs
-
onEnd
Called when a game ends.- Parameters:
context- Game contextresult- Game result with winner and players
-
onDisable
void onDisable()Called when module is unloaded (server shutdown/reload). -
registerEvents
-
onGameStart
Called after countdown finishes and game starts. -
onGameTick
-
onPlayerEliminate
-
onPlayerRespawn
-
getCustomPlaceholders
-
onCountdownTick
Called every tick during countdown phase. Use this to send countdown titles/sounds.- Parameters:
context- Game contextsecondsLeft- Seconds remaining in countdown
-
onCountdownFinish
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
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.
- 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 returnstrue, the core will never allow join-in-progress in party mode.- Returns:
trueto allow join-in-progress in standalone mode- Since:
- 3.2
-
onPlayerJoinInProgress
Called when a player joins an already-running match, right after the core has registered them in this game'sGameContext.Only invoked when
allowJoinInProgress()returnedtruefor 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
falseto 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 APIsplayer- the player joining the running match- Returns:
trueif the player was placed into the match successfully- Since:
- 3.4
-
getDisplayName
Returns a human-readable display name for this module. The default implementation returnsnull, 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
nullto use the descriptor fallback - Since:
- 3.3
-
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
falsekeeps core spawn setup commands available, but disables only the numeric one-spawn-per-player capacity check. UsegetDisabledRequirements()withSetupRequirement.SPAWNSwhen the module does not use the core spawn requirement at all.- Returns:
trueby default for backward-compatible validation- Since:
- 3.4
-