Package org.bukkit.event.player
Class PlayerSpawnChangeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerSpawnChangeEvent
- All Implemented Interfaces:
- Cancellable
This event is fired when the spawn point of the player is changed.
- 
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 SummaryConstructorsConstructorDescriptionPlayerSpawnChangeEvent(Player player, Location newSpawn, boolean forced, PlayerSpawnChangeEvent.Cause cause) 
- 
Method SummaryModifier and TypeMethodDescriptiongetCause()Gets the cause of spawn change.static HandlerListGets the new spawn to be set.booleanGets the cancellation state of this event.booleanisForced()Gets if the spawn position will be used regardless of bed obstruction rules.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetForced(boolean forced) Sets if the spawn position will be used regardless of bed obstruction rules.voidsetNewSpawn(Location newSpawn) Sets the new spawn location.Methods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventgetEventName, isAsynchronous
- 
Constructor Details- 
PlayerSpawnChangeEventpublic PlayerSpawnChangeEvent(@NotNull Player player, @Nullable Location newSpawn, boolean forced, @NotNull PlayerSpawnChangeEvent.Cause cause) 
 
- 
- 
Method Details- 
getCauseGets the cause of spawn change.- Returns:
- change cause
 
- 
isForcedpublic boolean isForced()Gets if the spawn position will be used regardless of bed obstruction rules.- Returns:
- true if is forced
 
- 
setForcedpublic void setForced(boolean forced) Sets if the spawn position will be used regardless of bed obstruction rules.- Parameters:
- forced- true if forced
 
- 
getNewSpawnGets the new spawn to be set.- Returns:
- new spawn location
 
- 
setNewSpawnSets the new spawn location.- Parameters:
- newSpawn- new spawn location, with non-null world
 
- 
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
 
-