From f1b8fcafff2cf9e053dce5ca89ce71729e56f29b Mon Sep 17 00:00:00 2001 From: MelnCat Date: Sun, 16 Oct 2022 12:10:00 -0700 Subject: [PATCH] Add entity knockback API --- .../main/java/org/bukkit/entity/LivingEntity.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 be91821c47..8ee3f82049 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -1361,4 +1361,18 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource } } // Paper end - swing hand API + + // Paper start - knockback API + /** + * Knocks back this entity from a specific direction with a specified strength. Mechanics such + * as knockback resistance will be factored in. + * + * The direction specified in this method will be the direction of the source of the knockback, + * so the entity will be pushed in the opposite direction. + * @param strength The strength of the knockback. Must be greater than 0. + * @param directionX The relative x position of the knockback source direction + * @param directionZ The relative z position of the knockback source direction + */ + void knockback(double strength, double directionX, double directionZ); + // Paper end - knockback API }