Class AsyncPlayerPreLoginEvent

java.lang.Object
net.minestom.server.event.player.AsyncPlayerPreLoginEvent
All Implemented Interfaces:
Event, EntityEvent, PlayerEvent

public class AsyncPlayerPreLoginEvent extends Object implements PlayerEvent
Called before the player initialization, it can be used to kick the player before any connection or to change his final username/uuid.
  • Constructor Details

  • Method Details

    • getUsername

      @NotNull public @NotNull String getUsername()
      Gets the player username.
      Returns:
      the player username
    • setUsername

      public void setUsername(@NotNull @NotNull String username)
      Changes the player username.
      Parameters:
      username - the new player username
    • getPlayerUuid

      @NotNull public @NotNull UUID getPlayerUuid()
      Gets the player uuid.
      Returns:
      the player uuid
    • setPlayerUuid

      public void setPlayerUuid(@NotNull @NotNull UUID playerUuid)
      Changes the player uuid.
      Parameters:
      playerUuid - the new player uuid
    • sendPluginRequest

      @NotNull public @NotNull CompletableFuture<LoginPluginResponse> sendPluginRequest(String channel, byte[] requestPayload)
      Sends a login plugin message request. Can be useful to negotiate with modded clients or proxies before moving on to the Configuration state.
      Parameters:
      channel - the plugin message channel
      requestPayload - the contents of the plugin message, can be null for empty
      Returns:
      a CompletableFuture for the response. The thread on which it completes is asynchronous.
    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player