Package org.spigotmc.event.player
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.
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
ConstructorsConstructorDescriptionPlayerSpawnLocationEvent
(@NotNull Player player, @NotNull Location spawnLocation) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull HandlerList
Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Gets player's spawn location.void
setSpawnLocation
(@NotNull Location location) Deprecated, for removal: This API element is subject to removal in a future version.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
-
Constructor Details
-
Method Details
-
getSpawnLocation
Deprecated, for removal: This API element is subject to removal in a future version.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
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
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getHandlers
in classEvent
-
getHandlerList
Deprecated, for removal: This API element is subject to removal in a future version.
-
PlayerEvent.getPlayer()
for anything related to the player entity is unreliable and may cause issues. RetrievingEntity.getUniqueId()
andPlayer.getName()
is safe. Prefer usingAsyncPlayerSpawnLocationEvent
.