Class PlayerChooseInitialServerEvent


  • @AwaitingEvent
    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 Detail

      • PlayerChooseInitialServerEvent

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

      • getPlayer

        public Player getPlayer()
      • setInitialServer

        public void setInitialServer​(@Nullable RegisteredServer server)
        Sets the new initial server.
        Parameters:
        server - the initial server the player should connect to