Class PlayerConnectionValidateLoginEvent

java.lang.Object
org.bukkit.event.Event
io.papermc.paper.event.connection.PlayerConnectionValidateLoginEvent

public class PlayerConnectionValidateLoginEvent extends Event
Validates whether a player connection is able to log in.

Called when is attempting to log in for the first time, or is finishing up being configured.

  • Constructor Details

  • Method Details

    • getConnection

      public PlayerConnection getConnection()
      Gets the connection of the player in this event. Note, the type of this connection is not guaranteed to be stable across versions. Additionally, disconnecting the player through this connection / using any methods that may send packets is not supported.
      Returns:
      connection
    • allow

      public void allow()
      Allows the player to log in. This skips any login validation checks.
    • kickMessage

      public void kickMessage(Component message)
      Disallows the player from logging in, with the given reason
      Parameters:
      message - Kick message to display to the user
    • getKickMessage

      public @Nullable Component getKickMessage()
      Gets the reason for why a player is not allowed to join the server. This will be null in the case that the player is allowed to log in.
      Returns:
      disallow reason
    • isAllowed

      public boolean isAllowed()
      Gets if the player is allowed to enter the next stage.
      Returns:
      if allowed
    • getHandlers

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

      public static HandlerList getHandlerList()