Package org.spigotmc.event.player
Class PlayerSpawnLocationEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.spigotmc.event.player.PlayerSpawnLocationEvent
public class PlayerSpawnLocationEvent extends PlayerEvent
Called when player is about to spawn in a world after joining the server.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PlayerSpawnLocationEvent(Player who, Location spawnLocation)
-
Method Summary
Modifier and Type Method Description static HandlerList
getHandlerList()
HandlerList
getHandlers()
Location
getSpawnLocation()
Gets player's spawn location.void
setSpawnLocation(Location location)
Sets player's spawn location.
-
Constructor Details
-
Method Details
-
getSpawnLocation
Gets player's spawn location. If the playerOfflinePlayer.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
Sets player's spawn location.- Parameters:
location
- the spawn location
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-