Class PlayerChooseInitialServerEvent
java.lang.Object
com.velocitypowered.api.event.player.PlayerChooseInitialServerEvent
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 Summary
ConstructorsConstructorDescriptionPlayerChooseInitialServerEvent(Player player, @Nullable RegisteredServer initialServer) Constructs a PlayerChooseInitialServerEvent. -
Method Summary
Modifier and TypeMethodDescriptionGets the initial server the player will connect to.Gets the player who is choosing the initial server.voidsetInitialServer(@Nullable RegisteredServer server) Sets the new initial server.toString()
-
Constructor Details
-
PlayerChooseInitialServerEvent
Constructs a PlayerChooseInitialServerEvent.- Parameters:
player- the player that was connectedinitialServer- the initial server selected, may benull
-
-
Method Details
-
getPlayer
Gets the player who is choosing the initial server.- Returns:
- the connected player
-
getInitialServer
Gets the initial server the player will connect to.- Returns:
- an
Optionalcontaining the selected server, or empty if none was set
-
setInitialServer
Sets the new initial server.- Parameters:
server- the initial server the player should connect to
-
toString
-