Class ServerPreConnectEvent
java.lang.Object
com.velocitypowered.api.event.player.ServerPreConnectEvent
- All Implemented Interfaces:
ResultedEvent<ServerPreConnectEvent.ServerResult>
public final class ServerPreConnectEvent
extends Object
implements ResultedEvent<ServerPreConnectEvent.ServerResult>
This event is fired before the player connects to a server. Velocity will wait on this event to
finish firing before initiating the connection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents the result of theServerPreConnectEvent.Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result -
Constructor Summary
ConstructorsConstructorDescriptionServerPreConnectEvent(Player player, RegisteredServer originalServer) Creates the ServerPreConnectEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the server that the player originally tried to connect to.Returns the player connecting to the server.Returns the result associated with this event.voidSets the result of this event.toString()
-
Constructor Details
-
ServerPreConnectEvent
Creates the ServerPreConnectEvent.- Parameters:
player- the player who is connecting to a serveroriginalServer- the server the player was trying to connect to
-
-
Method Details
-
getPlayer
Returns the player connecting to the server.- Returns:
- the player connecting to the server
-
getResult
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<ServerPreConnectEvent.ServerResult>- Returns:
- the result of this event
-
setResult
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<ServerPreConnectEvent.ServerResult>- Parameters:
result- the new result
-
getOriginalServer
Returns the server that the player originally tried to connect to. To get the server the player will connect to, see theServerPreConnectEvent.ServerResultof this event. To get the server the player is currently on when this event is fired, usePlayer.getCurrentServer().- Returns:
- the server that the player originally tried to connect to
-
toString
-