Class AsyncPlayerPreLoginEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.AsyncPlayerPreLoginEvent

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

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

  • Constructor Details

    • AsyncPlayerPreLoginEvent

      @Deprecated public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress)
      Deprecated.
    • AsyncPlayerPreLoginEvent

      @Deprecated public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId)
      Deprecated.
    • AsyncPlayerPreLoginEvent

      public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId, boolean transferred)
  • Method Details

    • getLoginResult

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

      @Deprecated @NotNull public PlayerPreLoginEvent.Result getResult()
      Deprecated.
      This method uses a deprecated enum from PlayerPreLoginEvent
      Gets the current result of the login, as an enum
      Returns:
      Current Result of the login
      See Also:
    • setLoginResult

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

      @Deprecated public void setResult(@NotNull PlayerPreLoginEvent.Result result)
      Deprecated.
      This method uses a deprecated enum from PlayerPreLoginEvent
      Sets the new result of the login, as an enum
      Parameters:
      result - New result to set
      See Also:
    • getKickMessage

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

      public void setKickMessage(@NotNull 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(@NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull 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
    • disallow

      @Deprecated public void disallow(@NotNull PlayerPreLoginEvent.Result result, @NotNull String message)
      Deprecated.
      This method uses a deprecated enum from PlayerPreLoginEvent
      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
      See Also:
    • getName

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

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

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

      public boolean isTransferred()
      Gets if this connection has been transferred from another server.
      Returns:
      true if the connection has been transferred
    • getHandlers

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

      @NotNull public static HandlerList getHandlerList()