Package io.papermc.paper.event.player
Class AsyncPlayerSpawnLocationEvent
java.lang.Object
org.bukkit.event.Event
io.papermc.paper.event.player.AsyncPlayerSpawnLocationEvent
Called when selecting a player's spawn location (i.e. joining the server or reconfiguring).
The player will be kept in the configuration phase until all event handlers return and the spawn location is loaded.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionAsyncPlayerSpawnLocationEvent
(PlayerConfigurationConnection connection, Location spawnLocation, boolean newPlayer) -
Method Summary
Modifier and TypeMethodDescriptionGets the spawning player's connection.static HandlerList
Gets the player's spawn location.boolean
Returns true if the player is joining the server for the first time.void
setSpawnLocation
(Location location) Sets player's spawn location.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
AsyncPlayerSpawnLocationEvent
@Internal public AsyncPlayerSpawnLocationEvent(PlayerConfigurationConnection connection, Location spawnLocation, boolean newPlayer)
-
-
Method Details
-
getConnection
Gets the spawning player's connection.- Returns:
- the player connection
-
getSpawnLocation
Gets the player's spawn location.If the player has played on this server before, defaults to the location inside the player data file. For new players, the default spawn location is the
spawn location
of therespawn world
.- Returns:
- the spawn location
-
setSpawnLocation
Sets player's spawn location.- Parameters:
location
- the spawn location
-
isNewPlayer
public boolean isNewPlayer()Returns true if the player is joining the server for the first time.- Returns:
- whether the player is new
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-