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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KickedFromServerEvent.ServerKickResultcreate(RegisteredServer server)Creates a new redirect result to forward the player to the specifiedserver.static KickedFromServerEvent.RedirectPlayercreate(RegisteredServer server, Component message)Creates a new redirect result to forward the player to the specifiedserver.@Nullable ComponentgetMessageComponent()RegisteredServergetServer()booleanisAllowed()Returns whether or not the event is allowed to proceed.
-
-
-
Method Detail
-
isAllowed
public boolean isAllowed()
Description copied from interface:ResultedEvent.ResultReturns 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:
isAllowedin interfaceResultedEvent.Result- Returns:
- whether or not the event is allowed to proceed
-
getServer
public RegisteredServer getServer()
-
getMessageComponent
public @Nullable Component getMessageComponent()
-
create
public static KickedFromServerEvent.RedirectPlayer create(RegisteredServer server, Component message)
Creates a new redirect result to forward the player to the specifiedserver. The specifiedmessagewill be sent to the player after the redirection. UseComponent.empty()to skip sending any messages to the player.- Parameters:
server- the server to send the player tomessage- the message will be sent to the player after redirecting- Returns:
- the redirect result
-
create
public static KickedFromServerEvent.ServerKickResult create(RegisteredServer server)
Creates a new redirect result to forward the player to the specifiedserver. The kick reason will be displayed to the player- Parameters:
server- the server to send the player to- Returns:
- the redirect result
-
-