From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Date: Sat, 11 Dec 2021 12:18:47 -0500 Subject: [PATCH] Paper PR - Add Movement Direction API diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java index 654dc0c6d98b29cf45d3826aece374726e3e9802..a1dfe9e1509a1b852e991e29c720fdfad596a2f8 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1149,6 +1149,44 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @see Location#setYaw(float) */ void setBodyYaw(float bodyYaw); + + /** + * This number represents how much the entity is trying to move sideways. + *
+ * This number is ranges from -1 to 1, + * where positive 1 represents the left and -1 represents the right. + *
+ * Note that for {@link Player} entities only update this value when riding an entity, which may cause it + * to be inaccurate when dismounted. + * + * @return direction repesented as -1 to 1 + */ + float getSidewaysMotion(); + + /** + * This number represents how much the entity is trying to move + * in the upwards direction. + *
+ * This number is ranges from -1 to 1, + * where positive 1 represents the up and -1 represents the down. + *
+ * Note that for {@link Player} entities this value is never updated. + * + * @return direction repesented as -1 to 1 + */ + float getUpwardsMotion(); + + /** + * This number represents how much the entity is trying to move forward. + *
+ * This number is ranges from -1 to 1, + * where positive 1 represents the up and -1 represents the down. + *
+ * Note that for {@link Player} entities only update this value when riding an entity, so it may be inaccurate when dismounted. + * + * @return direction repesented as -1 to 1 + */ + float getForwardMotion(); // Paper end // Purpur start