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 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
    • getReasonComponent

      public Component getReasonComponent()
      Returns the reason shown to the player upon disconnection.
      Returns:
      the reason component
    • create

      public static KickedFromServerEvent.DisconnectPlayer create(Component reason)
      Creates a new KickedFromServerEvent.DisconnectPlayer with the specified reason.
      Parameters:
      reason - the reason to use when disconnecting the player
      Returns:
      the disconnect result
    • toString

      public String toString()
      Overrides:
      toString in class Object