Class AsyncPlayerPreLoginEvent


  • public class AsyncPlayerPreLoginEvent
    extends Event
    Stores details for players attempting to log in.

    This event is asynchronous, and not run using main thread.

    • Method Detail

      • getLoginResult

        public AsyncPlayerPreLoginEvent.Result getLoginResult()
        Gets the current result of the login, as an enum
        Returns:
        Current Result of the login
      • setLoginResult

        public void setLoginResult​(AsyncPlayerPreLoginEvent.Result result)
        Sets the new result of the login, as an enum
        Parameters:
        result - New result to set
      • getKickMessage

        public String getKickMessage()
        Gets the current kick message that will be used if getResult() != Result.ALLOWED
        Returns:
        Current kick message
      • setKickMessage

        public void setKickMessage​(String message)
        Sets the kick message to display if getResult() != Result.ALLOWED
        Parameters:
        message - New kick message
      • allow

        public void allow()
        Allows the player to log in
      • disallow

        public void disallow​(AsyncPlayerPreLoginEvent.Result result,
                             String message)
        Disallows the player from logging in, with the given reason
        Parameters:
        result - New result for disallowing the player
        message - Kick message to display to the user
      • getName

        public String getName()
        Gets the player's name.
        Returns:
        the player's name
      • getAddress

        public InetAddress getAddress()
        Gets the player IP address.
        Returns:
        The IP address
      • getUniqueId

        public UUID getUniqueId()
        Gets the player's unique ID.
        Returns:
        The unique ID
      • getHandlerList

        public static HandlerList getHandlerList()