2022-10-18 09:33:58 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: MelnCat <melncatuwu@gmail.com>
|
|
|
|
Date: Sun, 16 Oct 2022 12:10:00 -0700
|
|
|
|
Subject: [PATCH] Add entity knockback API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
2024-09-15 21:39:53 +02:00
|
|
|
index 4ed60d7eae1b1c8980f8844b33151fd7c53207c2..86c5ceddc722d28261f8a6d8368400fe2731aaf0 100644
|
2022-10-18 09:33:58 +02:00
|
|
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
|
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
2024-09-15 21:39:53 +02:00
|
|
|
@@ -1361,4 +1361,18 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
2022-10-18 09:33:58 +02:00
|
|
|
}
|
|
|
|
}
|
2024-04-06 21:53:39 +02:00
|
|
|
// Paper end - swing hand API
|
2022-10-18 09:33:58 +02:00
|
|
|
+
|
2024-04-06 21:53:39 +02:00
|
|
|
+ // Paper start - knockback API
|
2022-10-18 09:33:58 +02:00
|
|
|
+ /**
|
|
|
|
+ * 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);
|
2024-04-06 21:53:39 +02:00
|
|
|
+ // Paper end - knockback API
|
2022-10-18 09:33:58 +02:00
|
|
|
}
|