Class PlayerSpawnLocationEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.spigotmc.event.player.PlayerSpawnLocationEvent

@Deprecated(since="1.21.9", forRemoval=true) public class PlayerSpawnLocationEvent extends PlayerEvent
Deprecated, for removal: This API element is subject to removal in a future version.
The spawn location is selected during the configuration phase, before a player entity is normally created. Using the result of PlayerEvent.getPlayer() for anything related to the player entity is unreliable and may cause issues. Retrieving Entity.getUniqueId() and Player.getName() is safe. Prefer using AsyncPlayerSpawnLocationEvent.
Called when player is about to spawn in a world after joining the server.
  • Constructor Details

    • PlayerSpawnLocationEvent

      public PlayerSpawnLocationEvent(Player player, Location spawnLocation)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • getSpawnLocation

      public Location getSpawnLocation()
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 the spawn location of the respawn world.
      Returns:
      the spawn location
    • setSpawnLocation

      public void setSpawnLocation(Location location)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets player's spawn location.
      Parameters:
      location - the spawn location
    • getHandlers

      public HandlerList getHandlers()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()
      Deprecated, for removal: This API element is subject to removal in a future version.