Class PlayerSetSpawnEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
com.destroystokyo.paper.event.player.PlayerSetSpawnEvent
- All Implemented Interfaces:
- Cancellable
Called when a player's spawn is set, either by themselves or otherwise.
Cancelling this event will prevent the spawn from being set.
Cancelling this event will prevent the spawn from being set.
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructorsConstructorDescriptionPlayerSetSpawnEvent(@NotNull Player who, @NotNull PlayerSetSpawnEvent.Cause cause, @Nullable Location location, boolean forced, boolean notifyPlayer, @Nullable Component notification) 
- 
Method SummaryModifier and TypeMethodDescriptiongetCause()Gets the cause of this event.static @NotNull HandlerListGets the location that the spawn is set to.Gets the notification message that will be sent to the player ifwillNotifyPlayer()returns true.booleanGets the cancellation state of this event.booleanisForced()Gets if this is a force spawn locationvoidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetForced(boolean forced) Sets if this is a forced spawn locationvoidsetLocation(@Nullable Location location) Sets the location to be set as the spawn location.voidsetNotification(@Nullable Component notification) Sets the notification message that will be sent to the player.voidsetNotifyPlayer(boolean notifyPlayer) Sets if this action will notify the player that their spawn has been set.booleanGets if this action will notify the player their spawn has been set.Methods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
PlayerSetSpawnEvent
 
- 
- 
Method Details- 
getCauseGets the cause of this event.- Returns:
- the cause
 
- 
getLocationGets the location that the spawn is set to. The yaw of this location is the spawn angle. Mutating this location will change the resulting spawn point of the player. UseLocation.clone()to get a copy of this location.- Returns:
- the spawn location, or null if removing the location
 
- 
setLocationSets the location to be set as the spawn location. The yaw of this location is the spawn angle.- Parameters:
- location- the spawn location, or null to remove the spawn location
 
- 
isForcedpublic boolean isForced()Gets if this is a force spawn location- Returns:
- true if forced
 
- 
setForcedpublic void setForced(boolean forced) Sets if this is a forced spawn location- Parameters:
- forced- true to force
 
- 
willNotifyPlayerpublic boolean willNotifyPlayer()Gets if this action will notify the player their spawn has been set.- Returns:
- true to notify
 
- 
setNotifyPlayerpublic void setNotifyPlayer(boolean notifyPlayer) Sets if this action will notify the player that their spawn has been set.- Parameters:
- notifyPlayer- true to notify
 
- 
getNotificationGets the notification message that will be sent to the player ifwillNotifyPlayer()returns true.- Returns:
- null if no notification
 
- 
setNotificationSets the notification message that will be sent to the player.- Parameters:
- notification- null to send no message
 
- 
isCancelledpublic boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic void setCancelled(boolean cancel) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-