Class KickedFromServerEvent.DisconnectPlayer
- java.lang.Object
-
- com.velocitypowered.api.event.player.KickedFromServerEvent.DisconnectPlayer
-
- All Implemented Interfaces:
KickedFromServerEvent.ServerKickResult,ResultedEvent.Result
- Enclosing class:
- KickedFromServerEvent
public static final class KickedFromServerEvent.DisconnectPlayer extends Object implements KickedFromServerEvent.ServerKickResult
Tells the proxy to disconnect the player with the specified reason.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KickedFromServerEvent.DisconnectPlayercreate(Component reason)Creates a newKickedFromServerEvent.DisconnectPlayerwith the specified reason.ComponentgetReasonComponent()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
-
getReasonComponent
public Component getReasonComponent()
-
create
public static KickedFromServerEvent.DisconnectPlayer create(Component reason)
Creates a newKickedFromServerEvent.DisconnectPlayerwith the specified reason.- Parameters:
reason- the reason to use when disconnecting the player- Returns:
- the disconnect result
-
-