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 Summary
Modifier and TypeMethodDescriptiondefault booleanDeclares whether players may join an in-progress match in standalone mode.default booleanShould players be frozen during countdown?getCustomPlaceholders(P player) default Set<SetupRequirement> Returns the set of default setup requirements that this module explicitly disables.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 voidvoidCalled when a game starts in an arena.voidregisterEvents(CustomEventRegistry<Ls, Pr> registry)
-
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
-
onEnd
-
onDisable
void onDisable()Called when module is unloaded (server shutdown/reload). -
registerEvents
-
onGameStart
-
onGameTick
-
onPlayerEliminate
-
onPlayerRespawn
-
getCustomPlaceholders
-
onCountdownTick
-
onCountdownFinish
-
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
-