Class PlayerMoveEvent
java.lang.Object
me.internalizable.numdrassl.api.event.player.PlayerMoveEvent
- All Implemented Interfaces:
Cancellable
Event fired when a player moves.
This includes position changes, rotation changes, and velocity changes.
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerMoveEvent(Player player, double fromX, double fromY, double fromZ, double toX, double toY, double toZ, float fromYaw, float fromPitch, float toYaw, float toPitch) -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet the distance moved.floatdoublegetFromX()doublegetFromY()floatdoublegetFromZ()floatdoublegetToX()doublegetToY()floatgetToYaw()doublegetToZ()booleanCheck if the position changed.booleanCheck if the rotation changed.booleanCheck if this event has been cancelled.voidsetCancelled(boolean cancelled) Set whether this event is cancelled.voidsetToPitch(float pitch) voidsetToX(double x) voidsetToY(double y) voidsetToYaw(float yaw) voidsetToZ(double z)
-
Constructor Details
-
PlayerMoveEvent
public PlayerMoveEvent(@Nonnull Player player, double fromX, double fromY, double fromZ, double toX, double toY, double toZ, float fromYaw, float fromPitch, float toYaw, float toPitch)
-
-
Method Details
-
getPlayer
-
getFromX
public double getFromX() -
getFromY
public double getFromY() -
getFromZ
public double getFromZ() -
getToX
public double getToX() -
getToY
public double getToY() -
getToZ
public double getToZ() -
setToX
public void setToX(double x) -
setToY
public void setToY(double y) -
setToZ
public void setToZ(double z) -
getFromYaw
public float getFromYaw() -
getFromPitch
public float getFromPitch() -
getToYaw
public float getToYaw() -
getToPitch
public float getToPitch() -
setToYaw
public void setToYaw(float yaw) -
setToPitch
public void setToPitch(float pitch) -
hasPositionChanged
public boolean hasPositionChanged()Check if the position changed. -
hasRotationChanged
public boolean hasRotationChanged()Check if the rotation changed. -
getDistance
public double getDistance()Get the distance moved. -
isCancelled
public boolean isCancelled()Description copied from interface:CancellableCheck if this event has been cancelled.- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if the event is cancelled
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:CancellableSet whether this event is cancelled.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancelled- true to cancel the event
-