Class ServerPostConnectEvent

java.lang.Object
com.velocitypowered.api.event.player.ServerPostConnectEvent

@Beta public class ServerPostConnectEvent extends Object
Fired after the player has connected to a server. The server the player is now connected to is available in Player.getCurrentServer(). Velocity will not wait on this event to finish firing.
  • Constructor Details

    • ServerPostConnectEvent

      public ServerPostConnectEvent(Player player, @Nullable RegisteredServer previousServer)
  • Method Details

    • getPlayer

      public Player getPlayer()
      Returns the player that has completed the connection to the server.
      Returns:
      the player
    • getPreviousServer

      public @Nullable RegisteredServer getPreviousServer()
      Returns the previous server the player was connected to. This is null if they were not connected to another server beforehand (for instance, if the player has just joined the proxy).
      Returns:
      the previous server the player was connected to
    • toString

      public String toString()
      Overrides:
      toString in class Object