Class KickedFromServerEvent.RedirectPlayer

java.lang.Object
com.velocitypowered.api.event.player.KickedFromServerEvent.RedirectPlayer
All Implemented Interfaces:
KickedFromServerEvent.ServerKickResult, ResultedEvent.Result
Enclosing class:
KickedFromServerEvent

public static final class KickedFromServerEvent.RedirectPlayer extends Object implements KickedFromServerEvent.ServerKickResult
Tells the proxy to redirect the player to another server.
  • Method Details

    • isAllowed

      public boolean isAllowed()
      Description copied from interface: ResultedEvent.Result
      Returns whether or not the event is allowed to proceed. Plugins may choose to skip denied events, and the proxy will respect the result of this method.
      Specified by:
      isAllowed in interface ResultedEvent.Result
      Returns:
      whether or not the event is allowed to proceed
    • getServer

      public @NonNull RegisteredServer getServer()
    • getMessageComponent

      public @Nullable Component getMessageComponent()
    • create

      public static KickedFromServerEvent.RedirectPlayer create(@NonNull RegisteredServer server, Component message)
      Creates a new redirect result to forward the player to the specified server. The specified message will be sent to the player after the redirection. Use Component.empty() to skip sending any messages to the player.
      Parameters:
      server - the server to send the player to
      message - the message will be sent to the player after redirecting
      Returns:
      the redirect result
    • create

      Creates a new redirect result to forward the player to the specified server. The kick reason will be displayed to the player
      Parameters:
      server - the server to send the player to
      Returns:
      the redirect result
    • toString

      public String toString()
      Overrides:
      toString in class Object