Class DisconnectEvent

java.lang.Object
com.velocitypowered.api.event.connection.DisconnectEvent

@AwaitingEvent public final class DisconnectEvent extends Object
This event is fired when a player disconnects from the proxy. This operation can take place when the player disconnects due to normal network activity or when the proxy shuts down. Operations on the provided player, aside from basic data retrieval operations, may behave in undefined ways.

Velocity typically fires this event asynchronously and does not wait for a response. However, it will wait for all DisconnectEvents for every player on the proxy to fire successfully before the proxy shuts down. This event is the sole exception to the AwaitingEvent contract.

  • Constructor Details

    • DisconnectEvent

      public DisconnectEvent(Player player, DisconnectEvent.LoginStatus loginStatus)
      Creates a new DisconnectEvent.
      Parameters:
      player - the player who disconnected
      loginStatus - the status of the player's login at the time of disconnection
  • Method Details

    • getPlayer

      public Player getPlayer()
      Returns the player who disconnected.
      Returns:
      the player
    • getLoginStatus

      public DisconnectEvent.LoginStatus getLoginStatus()
      Returns the login status of the player at the time of disconnection.
      Returns:
      the login status
    • toString

      public String toString()
      Overrides:
      toString in class Object