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 Deprecated Methods Modifier and Type Method Description static KickedFromServerEvent.DisconnectPlayer
create(Component reason)
Creates a newKickedFromServerEvent.DisconnectPlayer
with the specified reason.static KickedFromServerEvent.DisconnectPlayer
create(net.kyori.text.Component reason)
Deprecated.Usecreate(net.kyori.adventure.text.Component)
insteadnet.kyori.text.Component
getReason()
Deprecated.Component
getReasonComponent()
boolean
isAllowed()
Returns whether or not the event is allowed to proceed.
-
-
-
Method Detail
-
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 interfaceResultedEvent.Result
- Returns:
- whether or not the event is allowed to proceed
-
getReason
@Deprecated public net.kyori.text.Component getReason()
Deprecated.
-
getReasonComponent
public Component getReasonComponent()
-
create
@Deprecated public static KickedFromServerEvent.DisconnectPlayer create(net.kyori.text.Component reason)
Deprecated.Usecreate(net.kyori.adventure.text.Component)
insteadCreates a newKickedFromServerEvent.DisconnectPlayer
with the specified reason.- Parameters:
reason
- the reason to use when disconnecting the player- Returns:
- the disconnect result
-
create
public static KickedFromServerEvent.DisconnectPlayer create(Component reason)
Creates a newKickedFromServerEvent.DisconnectPlayer
with the specified reason.- Parameters:
reason
- the reason to use when disconnecting the player- Returns:
- the disconnect result
-
-