Class ServerPreConnectEvent

java.lang.Object
com.nickuc.login.api.event.internal.velocity.VelocityCancellableEvent
com.nickuc.login.api.event.velocity.connection.ServerPreConnectEvent
All Implemented Interfaces:
CancellableEvent, EventWithPlayer

public class ServerPreConnectEvent extends VelocityCancellableEvent implements EventWithPlayer
Event triggered when a server connection operation is initiated for a player.

Not available for PROXY implementations.

Since:
API v8
  • Constructor Details

    • ServerPreConnectEvent

      public ServerPreConnectEvent(com.velocitypowered.api.proxy.Player player, ServerConnectType serverConnectType, com.velocitypowered.api.proxy.server.RegisteredServer originalServer)
  • Method Details

    • getPlayer

      public com.velocitypowered.api.proxy.Player getPlayer()
      Returns the player instance.
      Specified by:
      getPlayer in interface EventWithPlayer
    • getServerConnectType

      public ServerConnectType getServerConnectType()
      Returns the type of connection used in this event.
    • getOriginalServer

      public com.velocitypowered.api.proxy.server.RegisteredServer getOriginalServer()
      Returns the server originally used to connect.
    • getServer

      public com.velocitypowered.api.proxy.server.RegisteredServer getServer()
      Returns the server used to connect.
    • setServer

      public void setServer(@Nonnull com.velocitypowered.api.proxy.server.RegisteredServer server)
      Defines the server that will be used for the connection.
      Parameters:
      server - the server used for the connection.