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 player's spawn location. If the player OfflinePlayer.hasPlayedBefore(), it's going to default to the location inside player.dat file. For new players, the default spawn location is spawn of the main Bukkit world.
      Returns:
      the spawn location
    • setSpawnLocation

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

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

      public static HandlerList getHandlerList()