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 SummaryNested ClassesModifier and TypeClassDescriptionstatic enumBasic kick reasons for communicating to plugins
- 
Constructor SummaryConstructorsConstructorDescriptionAsyncPlayerPreLoginEvent(String name, InetAddress ipAddress) Deprecated.AsyncPlayerPreLoginEvent(String name, InetAddress ipAddress, UUID uniqueId) Deprecated.AsyncPlayerPreLoginEvent(String name, InetAddress ipAddress, UUID uniqueId, boolean transferred) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidallow()Allows the player to log invoiddisallow(AsyncPlayerPreLoginEvent.Result result, String message) Disallows the player from logging in, with the given reasonvoiddisallow(PlayerPreLoginEvent.Result result, String message) Deprecated.Gets the player IP address.static HandlerListGets the current kick message that will be used if getResult() != Result.ALLOWEDGets the current result of the login, as an enumgetName()Gets the player's name.Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventGets the player's unique ID.booleanGets if this connection has been transferred from another server.voidsetKickMessage(String message) Sets the kick message to display if getResult() != Result.ALLOWEDvoidSets the new result of the login, as an enumvoidsetResult(PlayerPreLoginEvent.Result result) Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventMethods inherited from class org.bukkit.event.EventgetEventName, isAsynchronous
- 
Constructor Details- 
AsyncPlayerPreLoginEvent@Deprecated(since="1.7.5") public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress) Deprecated.
- 
AsyncPlayerPreLoginEvent@Deprecated(since="1.20.5") public AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId) Deprecated.
- 
AsyncPlayerPreLoginEventpublic AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull UUID uniqueId, boolean transferred) 
 
- 
- 
Method Details- 
getLoginResultGets the current result of the login, as an enum- Returns:
- Current Result of the login
 
- 
getResultDeprecated.This method uses a deprecated enum fromPlayerPreLoginEventGets the current result of the login, as an enum- Returns:
- Current Result of the login
- See Also:
 
- 
setLoginResultSets the new result of the login, as an enum- Parameters:
- result- New result to set
 
- 
setResultDeprecated.This method uses a deprecated enum fromPlayerPreLoginEventSets the new result of the login, as an enum- Parameters:
- result- New result to set
- See Also:
 
- 
getKickMessageGets the current kick message that will be used if getResult() != Result.ALLOWED- Returns:
- Current kick message
 
- 
setKickMessageSets the kick message to display if getResult() != Result.ALLOWED- Parameters:
- message- New kick message
 
- 
allowpublic void allow()Allows the player to log in
- 
disallowDisallows 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(since="1.3.2") public void disallow(@NotNull PlayerPreLoginEvent.Result result, @NotNull String message) Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventDisallows 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:
 
- 
getNameGets the player's name.- Returns:
- the player's name
 
- 
getAddressGets the player IP address.- Returns:
- The IP address
 
- 
getUniqueIdGets the player's unique ID.- Returns:
- The unique ID
 
- 
isTransferredpublic boolean isTransferred()Gets if this connection has been transferred from another server.- Returns:
- true if the connection has been transferred
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
- 
PlayerPreLoginEvent