Package org.bukkit.event.player
Class AsyncPlayerPreLoginEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.AsyncPlayerPreLoginEvent
Stores details for players attempting to log in.
This event is asynchronous, and not run using main thread.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Basic kick reasons for communicating to plugins -
Constructor Summary
ConstructorDescriptionAsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress)
Deprecated.AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull InetAddress rawAddress, @NotNull UUID uniqueId, @NotNull PlayerProfile profile)
AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId)
AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId, @NotNull PlayerProfile profile)
Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
allow()
Allows the player to log invoid
disallow(@NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull String message)
Deprecated.void
disallow(@NotNull AsyncPlayerPreLoginEvent.Result result, Component message)
Disallows the player from logging in, with the given reasonvoid
disallow(PlayerPreLoginEvent.Result result, @NotNull String message)
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
void
disallow(PlayerPreLoginEvent.Result result, Component message)
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Gets the player IP address.static @NotNull HandlerList
Deprecated.in favour ofkickMessage()
Gets the current result of the login, as an enumgetName()
Gets the player's name.Gets the PlayerProfile of the player logging inGets the raw address of the player logging inDeprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Gets the player's unique ID.Gets the current kick message that will be used if getResult() != Result.ALLOWEDvoid
kickMessage(Component message)
Sets the kick message to display if getResult() != Result.ALLOWEDvoid
setKickMessage(@NotNull String message)
Deprecated.in favour ofkickMessage(net.kyori.adventure.text.Component)
void
Sets the new result of the login, as an enumvoid
setPlayerProfile(@NotNull PlayerProfile profile)
void
setResult(PlayerPreLoginEvent.Result result)
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
AsyncPlayerPreLoginEvent
@Deprecated public AsyncPlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress)Deprecated. -
AsyncPlayerPreLoginEvent
-
AsyncPlayerPreLoginEvent
@Deprecated public AsyncPlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress, @NotNull @NotNull UUID uniqueId, @NotNull @NotNull PlayerProfile profile)Deprecated. -
AsyncPlayerPreLoginEvent
public AsyncPlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress, @NotNull @NotNull InetAddress rawAddress, @NotNull @NotNull UUID uniqueId, @NotNull @NotNull PlayerProfile profile)
-
-
Method Details
-
getPlayerProfile
Gets the PlayerProfile of the player logging in- Returns:
- The Profile
-
setPlayerProfile
-
getRawAddress
Gets the raw address of the player logging in- Returns:
- The address
-
getLoginResult
Gets the current result of the login, as an enum- Returns:
- Current Result of the login
-
getResult
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Gets the current result of the login, as an enum- Returns:
- Current Result of the login
- See Also:
getLoginResult()
-
setLoginResult
Sets the new result of the login, as an enum- Parameters:
result
- New result to set
-
setResult
Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Sets the new result of the login, as an enum- Parameters:
result
- New result to set- See Also:
setLoginResult(Result)
-
kickMessage
Gets the current kick message that will be used if getResult() != Result.ALLOWED- Returns:
- Current kick message
-
kickMessage
Sets the kick message to display if getResult() != Result.ALLOWED- Parameters:
message
- New kick message
-
disallow
public void disallow(@NotNull @NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull Component message)Disallows the player from logging in, with the given reason- Parameters:
result
- New result for disallowing the playermessage
- Kick message to display to the user
-
disallow
@Deprecated public void disallow(@NotNull PlayerPreLoginEvent.Result result, @NotNull Component message)Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Disallows the player from logging in, with the given reason- Parameters:
result
- New result for disallowing the playermessage
- Kick message to display to the user- See Also:
disallow(Result, String)
-
getKickMessage
Deprecated.in favour ofkickMessage()
Gets the current kick message that will be used if getResult() != Result.ALLOWED- Returns:
- Current kick message
-
setKickMessage
Deprecated.in favour ofkickMessage(net.kyori.adventure.text.Component)
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
@Deprecated public void disallow(@NotNull @NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull @NotNull String message)Deprecated.Disallows the player from logging in, with the given reason- Parameters:
result
- New result for disallowing the playermessage
- Kick message to display to the user
-
disallow
@Deprecated public void disallow(@NotNull PlayerPreLoginEvent.Result result, @NotNull @NotNull String message)Deprecated.This method uses a deprecated enum fromPlayerPreLoginEvent
Disallows the player from logging in, with the given reason- Parameters:
result
- New result for disallowing the playermessage
- Kick message to display to the user- See Also:
disallow(Result, String)
-
getName
Gets the player's name.- Returns:
- the player's name
-
getAddress
Gets the player IP address.- Returns:
- The IP address
-
getUniqueId
Gets the player's unique ID.- Returns:
- The unique ID
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-
disallow(org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result, net.kyori.adventure.text.Component)