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
public class PlayerMoveEvent extends PlayerEvent implements Cancellable
Holds information for player movement events
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
-
Field Summary
-
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
-
Constructor Summary
Constructors Constructor Description PlayerMoveEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull LocationgetFrom()Gets the location this player moved fromstatic @NotNull HandlerListgetHandlerList()@NotNull HandlerListgetHandlers()@Nullable LocationgetTo()Gets the location this player moved tobooleanisCancelled()Gets the cancellation state of this event.voidsetCancelled(boolean cancel)Sets the cancellation state of this event.voidsetFrom(@NotNull Location from)Sets the location to mark as where the player moved fromvoidsetTo(@NotNull Location to)Sets the location that this player will move to-
Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
-
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
-
-
-
Method Detail
-
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:
- true if 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 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 interfaceCancellable- Parameters:
cancel- true if you wish to cancel this event
-
getFrom
@NotNull public @NotNull Location getFrom()
Gets the location this player moved from- Returns:
- Location the player moved from
-
setFrom
public void setFrom(@NotNull @NotNull Location from)Sets the location to mark as where the player moved from- Parameters:
from- New location to mark as the players previous location
-
getTo
@Nullable public @Nullable Location getTo()
Gets the location this player moved to- Returns:
- Location the player moved to
-
setTo
public void setTo(@NotNull @NotNull Location to)Sets the location that this player will move to- Parameters:
to- New Location this player will move to
-
getHandlers
@NotNull public @NotNull HandlerList getHandlers()
- Specified by:
getHandlersin classEvent
-
getHandlerList
@NotNull public static @NotNull HandlerList getHandlerList()
-
-