Package org.spigotmc.event.player

# Class PlayerSpawnLocationEvent

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

Direct Known Subclasses:
  `PlayerInitialSpawnEvent`

public class PlayerSpawnLocationEvent extends PlayerEvent
Called when player is about to spawn in a world after joining the server.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.player.PlayerEvent

`player`

## Constructor Summary

Constructors
Constructor
Description
`PlayerSpawnLocationEvent(@NotNull Player who, @NotNull Location spawnLocation)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@NotNull Location`
`getSpawnLocation()`
Gets player's spawn location.
`void`
`setSpawnLocation(@NotNull Location location)`
Sets player's spawn location.

### Methods inherited from class org.bukkit.event.player.PlayerEvent

`getPlayer`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PlayerSpawnLocationEvent

public PlayerSpawnLocationEvent(@NotNull @NotNull Player who, @NotNull @NotNull Location spawnLocation)

## Method Details

### getSpawnLocation

@NotNull public @NotNull 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(@NotNull @NotNull Location location)
Sets player's spawn location.

Parameters:
  `location` - the spawn location

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()