Class PlayerChooseInitialServerEvent


public class PlayerChooseInitialServerEvent extends Object
Fired when a player has finished the login process, and we need to choose the first server to connect to. Velocity will wait on this event to finish firing before initiating the connection but you should try to limit the work done in this event. Failures will be handled by KickedFromServerEvent as normal.
  • Constructor Details

    • PlayerChooseInitialServerEvent

      public PlayerChooseInitialServerEvent(Player player, @Nullable RegisteredServer initialServer)
      Constructs a PlayerChooseInitialServerEvent.
      player - the player that was connected
      initialServer - the initial server selected, may be null
  • Method Details

    • getPlayer

      public Player getPlayer()
    • getInitialServer

      public Optional<RegisteredServer> getInitialServer()
    • setInitialServer

      public void setInitialServer(RegisteredServer server)
      Sets the new initial server.
      server - the initial server the player should connect to
    • toString

      public String toString()
      toString in class Object