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 Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
Constructors -
Method Summary
Modifier 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 PlayerEvent
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerMoveEvent
-
-
Method Details
-
getFrom
-
setFrom
-
getTo
-
setTo
-
hasChangedPosition
public 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
-
hasExplicitlyChangedPosition
public 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
-
hasChangedBlock
public 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
-
hasExplicitlyChangedBlock
public 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
-
hasChangedOrientation
public boolean hasChangedOrientation()Check if the player has changed orientation in the event- Returns:
- whether the player has changed orientation or not
-
isCancelled
public 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 interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public 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 plugins.If 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 interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-