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(@NotNull String name, @NotNull InetAddress ipAddress) Deprecated.AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull InetAddress rawAddress, @NotNull UUID uniqueId, @NotNull PlayerProfile profile) Deprecated.AsyncPlayerPreLoginEvent(@NotNull String name, @NotNull InetAddress ipAddress, @NotNull InetAddress rawAddress, @NotNull UUID uniqueId, @NotNull PlayerProfile profile, @NotNull String hostname) 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 SummaryModifier and TypeMethodDescriptionvoidallow()Allows the player to log invoiddisallow(@NotNull AsyncPlayerPreLoginEvent.Result result, @NotNull String message) Deprecated.voiddisallow(@NotNull AsyncPlayerPreLoginEvent.Result result, Component message) Disallows the player from logging in, with the given reasonvoiddisallow(PlayerPreLoginEvent.Result result, @NotNull String message) Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventvoiddisallow(PlayerPreLoginEvent.Result result, Component message) Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventGets the player IP address.static @NotNull HandlerListGets the hostname that the player used to connect to the server, or blank if unknownDeprecated.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 fromPlayerPreLoginEventGets the player's unique ID.Gets the current kick message that will be used if getResult() != Result.ALLOWEDvoidkickMessage(Component message) Sets the kick message to display if getResult() != Result.ALLOWEDvoidsetKickMessage(@NotNull String message) Deprecated.in favour ofkickMessage(net.kyori.adventure.text.Component)voidSets the new result of the login, as an enumvoidsetPlayerProfile(@NotNull PlayerProfile profile) Changes the PlayerProfile the player will login asvoidsetResult(PlayerPreLoginEvent.Result result) Deprecated.This method uses a deprecated enum fromPlayerPreLoginEventMethods inherited from class org.bukkit.event.EventcallEvent, 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@Deprecated public AsyncPlayerPreLoginEvent(@NotNull @NotNull String name, @NotNull @NotNull InetAddress ipAddress, @NotNull @NotNull InetAddress rawAddress, @NotNull @NotNull UUID uniqueId, @NotNull @NotNull PlayerProfile profile) Deprecated.
- 
AsyncPlayerPreLoginEvent
 
- 
- 
Method Details- 
getPlayerProfileGets the PlayerProfile of the player logging in- Returns:
- The Profile
 
- 
setPlayerProfileChanges the PlayerProfile the player will login as- Parameters:
- profile- The profile to use
 
- 
getRawAddressGets the raw address of the player logging in- Returns:
- The address
 
- 
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:
 
- 
kickMessageGets the current kick message that will be used if getResult() != Result.ALLOWED- Returns:
- Current kick message
 
- 
kickMessageSets the kick message to display if getResult() != Result.ALLOWED- Parameters:
- message- New kick message
 
- 
disallowpublic 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 player
- message- 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 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:
 
- 
getKickMessageDeprecated.in favour ofkickMessage()Gets the current kick message that will be used if getResult() != Result.ALLOWED- Returns:
- Current kick message
 
- 
setKickMessageDeprecated.in favour ofkickMessage(net.kyori.adventure.text.Component)Sets the kick message to display if getResult() != Result.ALLOWED- Parameters:
- message- New kick message
 
- 
allowpublic 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 player
- message- 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 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
 
- 
getHostnameGets the hostname that the player used to connect to the server, or blank if unknown- Returns:
- The hostname
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
- 
disallow(org.bukkit.event.player.AsyncPlayerPreLoginEvent.Result, net.kyori.adventure.text.Component)