mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
5730a94208
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 2b4582fb SPIGOT-5916: getLastColors does not work with the rgb colors CraftBukkit Changes: f7707086d SPIGOT-7299: Fix indirect/anvil damage events and minor improvements
28 lines
1.3 KiB
Diff
28 lines
1.3 KiB
Diff
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
|
|
index c689003cbec3936a8e02829f0fdfa0e7989df6ee..454376eada83adc3c7c83a7b720500f998f5593d 100644
|
|
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
|
@@ -1072,5 +1072,17 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
|
this.swingOffHand();
|
|
}
|
|
}
|
|
+
|
|
+ /**
|
|
+ * 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
|
|
}
|