Skip to content

PlayerLeaveGameEvent

PlayerLeaveGameEvent fires before cleanup, teleportation, and temporary-stat reset. The player and current run values are still attached to the game.

The event is informational and cannot prevent departure.


MethodReturn typeDescription
getGame()GameGame being left.
getReason()LeaveReasonCause of departure.
getPlayer()PlayerLeaving Bukkit player.
getUser()UserWhack Me user with temporary values still available.

LeaveReasonMeaning
FINISHNormal timer expiry.
LEAVE_COMMANDPlayer used /wm leave.
KICKAdministrator used /wm kick.
QUITPlayer disconnected.
RELOADReload interrupted the game.
SHUTDOWNServer shutdown interrupted the game.
STOP_COMMANDAdministrator force-stopped the game.
ARENA_DELETEDActive arena was deleted.
@EventHandler
public void onLeave(PlayerLeaveGameEvent event) {
getLogger().info(event.getPlayer().getName() + " left Whack Me: " + event.getReason());
}

Forced-stop paths can also produce a later GameStopEvent after cleanup.