Class PlayerPreLoginEvent

java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.player.PlayerPreLoginEvent

public class PlayerPreLoginEvent
extends Event
Called before the player initialization, it can be used to kick the player before any connection or to change his final username/uuid.
  • Constructor Summary

    Constructors 
    Constructor Description
    PlayerPreLoginEvent​(Player player, java.lang.String username, java.util.UUID playerUuid)  
  • Method Summary

    Modifier and Type Method Description
    Player getPlayer()
    Gets the player who is trying to connect.
    java.util.UUID getPlayerUuid()
    Gets the player uuid.
    java.lang.String getUsername()
    Gets the player username.
    void setPlayerUuid​(java.util.UUID playerUuid)
    Changes the player uuid.
    void setUsername​(java.lang.String username)
    Changes the player username.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerPreLoginEvent

      public PlayerPreLoginEvent​(@NotNull Player player, @NotNull java.lang.String username, @NotNull java.util.UUID playerUuid)
  • Method Details

    • getPlayer

      @NotNull public Player getPlayer()
      Gets the player who is trying to connect.
      Returns:
      the player
    • getUsername

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

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

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

      public void setPlayerUuid​(@NotNull java.util.UUID playerUuid)
      Changes the player uuid.
      Parameters:
      playerUuid - the new player uuid