Class PlayerPreLoginEvent

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

@Deprecated(since="1.3.2") public class PlayerPreLoginEvent extends Event
Deprecated.
This event causes synchronization from the login thread; AsyncPlayerPreLoginEvent is preferred to keep the secondary threads asynchronous.
Stores details for players attempting to log in

When this event is fired, the player's locale is not available. Therefore, any translatable component will be rendered with the default locale, Locale.US.

Consider rendering any translatable yourself with GlobalTranslator.render(net.kyori.adventure.text.Component, java.util.Locale) if the client's language is known.

  • Constructor Details

    • PlayerPreLoginEvent

      @Internal @Deprecated(since="1.7.5", forRemoval=true) public PlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • PlayerPreLoginEvent

      @Internal public PlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress, @NotNull @NotNull UUID uniqueId)
      Deprecated.
  • Method Details

    • getResult

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

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

      @NotNull public @NotNull Component kickMessage()
      Deprecated.
      Gets the current kick message that will be used when the outcome is not allowed
      Returns:
      Current kick message
    • kickMessage

      public void kickMessage(@NotNull @NotNull Component message)
      Deprecated.
      Sets the kick message to display when the outcome is not allowed
      Parameters:
      message - New kick message
    • disallow

      public void disallow(@NotNull @NotNull PlayerPreLoginEvent.Result result, @NotNull @NotNull Component message)
      Deprecated.
      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
    • getKickMessage

      @Deprecated @NotNull public @NotNull String getKickMessage()
      Deprecated.
      in favour of kickMessage()
      Gets the current kick message that will be used when the outcome is not allowed
      Returns:
      Current kick message
    • setKickMessage

      @Deprecated public void setKickMessage(@NotNull @NotNull String message)
      Deprecated.
      Sets the kick message to display when the outcome is not allowed
      Parameters:
      message - New kick message
    • allow

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

      @Deprecated public void disallow(@NotNull @NotNull PlayerPreLoginEvent.Result result, @NotNull @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
    • getName

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

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

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

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

      @NotNull public static @NotNull HandlerList getHandlerList()
      Deprecated.