Class PlayerLeaveGameEvent<P>

java.lang.Object
net.blueva.arcade.api.events.GameEvent
net.blueva.arcade.api.events.PlayerLeaveGameEvent<P>
Type Parameters:
P - the player type (platform-specific)

public class PlayerLeaveGameEvent<P> extends GameEvent
Event fired when a player leaves a game.

This event is triggered whenever a player exits a game, whether voluntarily or involuntarily. The leave reason provides context about why the player left the game. Game modules can listen to this event to handle player departures and update game state accordingly.

  • Constructor Details

    • PlayerLeaveGameEvent

      public PlayerLeaveGameEvent(int arenaId, String gameId, P player, PlayerLeaveGameEvent.LeaveReason reason)
      Constructs a new PlayerLeaveGameEvent.
      Parameters:
      arenaId - the ID of the arena the player is leaving
      gameId - the unique identifier of the game module
      player - the player who is leaving the game
      reason - the reason why the player is leaving
  • Method Details

    • getPlayer

      public P getPlayer()
      Gets the player who is leaving the game.
      Returns:
      the player leaving the game
    • getReason

      Gets the reason why the player is leaving.
      Returns:
      the leave reason