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
Modifier and TypeMethodDescriptioncreate(@NonNull RegisteredServer server, Component message) Creates a new redirect result to forward the player to the specifiedserver.create(RegisteredServer server) Creates a new redirect result to forward the player to the specifiedserver.@Nullable Component@NonNull RegisteredServerbooleanReturns whether or not the event is allowed to proceed.toString()
-
Method Details
-
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
-
getMessageComponent
-
create
public static KickedFromServerEvent.RedirectPlayer create(@NonNull 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
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
-
toString
-