Class ProfileWhitelistVerifyEvent

java.lang.Object
org.bukkit.event.Event
com.destroystokyo.paper.event.profile.ProfileWhitelistVerifyEvent

@NullMarked public class ProfileWhitelistVerifyEvent extends Event
Fires when the server needs to verify if a player is whitelisted.

Plugins may override/control the servers whitelist with this event, and dynamically change the kick message.

  • Constructor Details

  • Method Details

    • getKickMessage

      @Deprecated public @Nullable String getKickMessage()
      Deprecated.
      Returns:
      the currently planned message to send to the user if they are not whitelisted
    • setKickMessage

      @Deprecated public void setKickMessage(@Nullable String kickMessage)
      Deprecated.
      Parameters:
      kickMessage - The message to send to the player on kick if not whitelisted. May set to null to use the server configured default
    • kickMessage

      @Contract(pure=true) public @Nullable Component kickMessage()
      Returns:
      the currently planned message to send to the user if they are not whitelisted
    • kickMessage

      public void kickMessage(@Nullable Component kickMessage)
      Parameters:
      kickMessage - The message to send to the player on kick if not whitelisted. May set to null to use the server configured default
    • getPlayerProfile

      public PlayerProfile getPlayerProfile()
      Returns:
      The profile of the player trying to connect
    • isWhitelisted

      public boolean isWhitelisted()
      Returns:
      Whether the player is whitelisted to play on this server (whitelist may be off is why it's true)
    • setWhitelisted

      public void setWhitelisted(boolean whitelisted)
      Changes the players whitelisted state. false will deny the login
      Parameters:
      whitelisted - The new whitelisted state
    • isOp

      public boolean isOp()
      Returns:
      if the player obtained whitelist status by having op
    • isWhitelistEnabled

      public boolean isWhitelistEnabled()
      Returns:
      if the server even has whitelist on
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()