diff --git a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java index 46347b9cbf..3582d2ffa1 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -366,4 +366,19 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti * @return whether the operation was successful */ public boolean setLeashHolder(Entity holder); + + /** + * Checks to see if an entity is gliding, such as using an Elytra. + * @return True if this entity is gliding. + */ + public boolean isGliding(); + + /** + * Makes entity start or stop gliding. This will work even if an Elytra + * is not equipped, but will be reverted by the server immediately after + * unless an event-cancelling mechanism is put in place. + * @param gliding True if the entity is gliding. + */ + public void setGliding(boolean gliding); + } diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityToggleGlideEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityToggleGlideEvent.java new file mode 100644 index 0000000000..67fbf8fb13 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityToggleGlideEvent.java @@ -0,0 +1,50 @@ +package org.bukkit.event.entity; + +import org.bukkit.entity.LivingEntity; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; + +/** + * Sent when an entity's gliding status is toggled with an Elytra. + * Examples of when this event would be called: + *