Package org.bukkit.event.player
Class PlayerMoveEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerMoveEvent
- All Implemented Interfaces:
- Cancellable
- Direct Known Subclasses:
- PlayerTeleportEvent
Holds information for player movement events
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetFrom()Gets the location this player moved fromstatic @NotNull HandlerListgetTo()Gets the location this player moved tobooleanCheck if the player has moved to a new block in the eventbooleanCheck if the player has changed orientation in the eventbooleanCheck if the player has changed position (even within the same block) in the eventbooleanCheck if the player has moved to a new block in the event, disregarding a possible world changebooleanCheck if the player has changed position (even within the same block) in the event, disregarding a possible world changebooleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidSets the location to mark as where the player moved fromvoidSets the location that this player will move toMethods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
PlayerMoveEvent
 
- 
- 
Method Details- 
isCancelledpublic boolean isCancelled()Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other pluginsIf a move or teleport event is cancelled, the player will be moved or teleported back to the Location as defined by getFrom(). This will not fire an event - Specified by:
- isCancelledin interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic void setCancelled(boolean cancel) Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other pluginsIf a move or teleport event is cancelled, the player will be moved or teleported back to the Location as defined by getFrom(). This will not fire an event - Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getFromGets the location this player moved from- Returns:
- Location the player moved from
 
- 
setFromSets the location to mark as where the player moved from- Parameters:
- from- New location to mark as the players previous location
 
- 
getToGets the location this player moved to- Returns:
- Location the player moved to
 
- 
setToSets the location that this player will move to- Parameters:
- to- New Location this player will move to
 
- 
hasChangedPositionpublic boolean hasChangedPosition()Check if the player has changed position (even within the same block) in the event- Returns:
- whether the player has changed position or not
 
- 
hasExplicitlyChangedPositionpublic boolean hasExplicitlyChangedPosition()Check if the player has changed position (even within the same block) in the event, disregarding a possible world change- Returns:
- whether the player has changed position or not
 
- 
hasChangedBlockpublic boolean hasChangedBlock()Check if the player has moved to a new block in the event- Returns:
- whether the player has moved to a new block or not
 
- 
hasExplicitlyChangedBlockpublic boolean hasExplicitlyChangedBlock()Check if the player has moved to a new block in the event, disregarding a possible world change- Returns:
- whether the player has moved to a new block or not
 
- 
hasChangedOrientationpublic boolean hasChangedOrientation()Check if the player has changed orientation in the event- Returns:
- whether the player has changed orientation or not
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-