GameStopEvent
The GameStopEvent is fired after KOTL completes game cleanup.
Technical Overview
Section titled “Technical Overview”- Package:
dev.despical.kotl.api.events.game - Parent Class:
GameEvent - Cancellable: No
Cleanup State
Section titled “Cleanup State”Before this event fires:
- Players receive the configured stop message when one exists.
- Players are teleported to the arena end location where possible.
- Inventory and player state restoration is scheduled or completed.
- Players are removed from the game set.
- Scoreboards and boss bars are removed.
The event keeps an immutable UUID snapshot of players captured before cleanup.
Stop Reasons
Section titled “Stop Reasons”| Reason | Description |
|---|---|
ARENA_DELETED | The arena was permanently deleted. |
ARENA_DISABLED | The arena availability toggle was disabled. |
SERVER_RELOAD | KOTL or the server is reloading. |
SERVER_SHUTDOWN | The server is shutting down. |
STOP_COMMAND | An administrator used /kotl stop. |
Methods
Section titled “Methods”| Method | Return Type | Description |
|---|---|---|
getGame() | Game | Game that was stopped. |
getArena() | Arena | Arena associated with the game. |
getReason() | StopReason | Cleanup reason. |
getStoppedPlayers() | List<UUID> | Immutable pre-cleanup player snapshot. |
Example
Section titled “Example”import dev.despical.kotl.api.events.game.GameStopEvent;import dev.despical.kotl.game.StopReason;import org.bukkit.event.EventHandler;
@EventHandlerpublic void onGameStop(GameStopEvent event) { StopReason reason = event.getReason();
if (reason == StopReason.ARENA_DISABLED) { System.out.println("Maintenance started for " + event.getArena().getId()); }}