mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 20:23:53 -07:00
LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item Also aliased isHandsRaised for isChargingAttack in RangedEntity
This commit is contained in:
@@ -8,7 +8,7 @@ and to perform an attack.
|
||||
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
||||
new file mode 100644
|
||||
index 00000000..5153efab
|
||||
index 00000000..7b07f10c
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
|
||||
@@ -0,0 +0,0 @@
|
||||
@@ -26,10 +26,19 @@ index 00000000..5153efab
|
||||
+ void rangedAttack(LivingEntity target, float charge);
|
||||
+
|
||||
+ /**
|
||||
+ * Sets that the Entity is "charging" up an attack, by raising its arms
|
||||
+ * @param charging Whether the entities arms are raised to charge attack
|
||||
+ * Sets that the Entity is "charging" up an attack, by raising its hands
|
||||
+ *
|
||||
+ * @param raiseHands Whether the entities hands are raised to charge attack
|
||||
+ */
|
||||
+ void setChargingAttack(boolean charging);
|
||||
+ void setChargingAttack(boolean raiseHands);
|
||||
+
|
||||
+ /**
|
||||
+ * Alias to {@link LivingEntity#isHandRaised()}, if the entity is charging an attack
|
||||
+ * @return If entities hands are raised
|
||||
+ */
|
||||
+ default boolean isChargingAttack() {
|
||||
+ return isHandRaised();
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Illusioner.java b/src/main/java/org/bukkit/entity/Illusioner.java
|
||||
index 7c92c431..14e6c5ee 100644
|
||||
|
Reference in New Issue
Block a user