public class EntityMoveEvent extends EntityEvent implements Cancellable
Event.Resultentity| Constructor and Description |
|---|
EntityMoveEvent(@NotNull LivingEntity entity,
@NotNull Location from,
@NotNull Location to) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull LivingEntity |
getEntity()
Returns the Entity involved in this event
|
@NotNull Location |
getFrom()
Gets the location this entity moved from
|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@NotNull Location |
getTo()
Gets the location this entity moved to
|
boolean |
hasChangedBlock()
Check if the entity has moved to a new block in the event
|
boolean |
hasChangedOrientation()
Check if the entity has changed orientation in the event
|
boolean |
hasChangedPosition()
Check if the entity has changed position (even within the same block) in the event
|
boolean |
hasExplicitlyChangedBlock()
Check if the entity has moved to a new block in the event, disregarding a possible world change
|
boolean |
hasExplicitlyChangedPosition()
Check if the entity has changed position (even within the same block) in the event, disregarding a possible world change
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setFrom(@NotNull Location from)
Sets the location to mark as where the entity moved from
|
void |
setTo(@NotNull Location to)
Sets the location that this entity will move to
|
getEntityTypecallEvent, getEventName, isAsynchronous@NotNull public @NotNull LivingEntity getEntity()
EntityEventgetEntity in class EntityEventpublic boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
CancellablesetCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public @NotNull Location getFrom()
public void setFrom(@NotNull @NotNull Location from)
from - New location to mark as the entity's previous location@NotNull public @NotNull Location getTo()
public void setTo(@NotNull @NotNull Location to)
to - New Location this entity will move topublic boolean hasChangedPosition()
public boolean hasExplicitlyChangedPosition()
public boolean hasChangedBlock()
public boolean hasExplicitlyChangedBlock()
public boolean hasChangedOrientation()
@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class Event@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.