GameEvent
GameEvent is the abstract base for KOTL events associated with one game instance.
Technical Overview
Section titled “Technical Overview”- Package:
dev.despical.kotl.api.events.game - Parent Class:
KOTLEvent
Methods
Section titled “Methods”| Method | Return Type | Description |
|---|---|---|
getGame() | Game | Associated game instance. |
getArena() | Arena | Arena owned by the game. |
Through Game, integrations can inspect the player snapshot, ScoreboardManager, and BossBarManager.
Known Subclass
Section titled “Known Subclass”GameStopEvent: Fired after an arena game has been stopped and cleaned up.
Listener Example
Section titled “Listener Example”import dev.despical.kotl.api.events.game.GameStopEvent;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;
public final class GameLifecycleListener implements Listener {
@EventHandler public void onGameStop(GameStopEvent event) { String arenaId = event.getArena().getId(); int stoppedPlayers = event.getStoppedPlayers().size();
System.out.println(arenaId + " stopped with " + stoppedPlayers + " players."); }}