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) -
Method Summary
Modifier and TypeMethodDescriptionGets the spawning player's connection.static HandlerListGets player's spawn location.voidsetSpawnLocation(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)
-
-
Method Details
-
getConnection
Gets the spawning player's connection.- Returns:
- the player connection
-
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:
getHandlersin classEvent
-
getHandlerList
-