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

  • Method Details

    • getSpawnLocation

      @NotNull public @NotNull 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 spawn of the main Bukkit world.
      Returns:
      the spawn location
    • setSpawnLocation

      public void setSpawnLocation(@NotNull @NotNull 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

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

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