Class AsyncPlayerSpawnLocationEvent

java.lang.Object
org.bukkit.event.Event
io.papermc.paper.event.player.AsyncPlayerSpawnLocationEvent

@Experimental @NullMarked public class AsyncPlayerSpawnLocationEvent extends Event
Called when selecting a player's spawn location (i.e. joining the server or reconfiguring).

The player will be kept in the configuration phase until all event handlers return and the spawn location is loaded.

  • Constructor Details

  • Method Details

    • getConnection

      public PlayerConfigurationConnection getConnection()
      Gets the spawning player's connection.
      Returns:
      the player connection
    • getSpawnLocation

      public Location getSpawnLocation()
      Gets the player's spawn location.

      If the player has played on this server before, defaults to the location inside the player data file. For new players, the default spawn location is the spawn location of the respawn world.

      Returns:
      the spawn location
    • setSpawnLocation

      public void setSpawnLocation(Location location)
      Sets player's spawn location.
      Parameters:
      location - the spawn location
    • isNewPlayer

      public boolean isNewPlayer()
      Returns true if the player is joining the server for the first time.
      Returns:
      whether the player is new
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()