mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-06 15:12:13 -07:00
Add more item use API (#10304)
This commit is contained in:
@@ -63,6 +63,35 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ // Paper start - active item API
|
||||
+ /**
|
||||
+ * Starts using the item in the specified hand, making it the
|
||||
+ * currently active item. When, for example, called on a skeleton,
|
||||
+ * this will cause it to start drawing its bow.
|
||||
+ * <p>
|
||||
+ * Only HAND or OFF_HAND may be used for the hand parameter.
|
||||
+ * <p>
|
||||
+ * When used on a player, the client will stop using the item
|
||||
+ * if right click is held down.
|
||||
+ * <p>
|
||||
+ * This method does not make any guarantees about the effect of this method
|
||||
+ * as such depends on the entity and its state.
|
||||
+ *
|
||||
+ * @param hand the hand that contains the item to be used
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ void startUsingItem(@NotNull org.bukkit.inventory.EquipmentSlot hand);
|
||||
+
|
||||
+ /**
|
||||
+ * Finishes using the currently active item. When, for example, a
|
||||
+ * skeleton is drawing its bow, this will cause it to release and
|
||||
+ * fire the arrow.
|
||||
+ * <p>
|
||||
+ * This method does not make any guarantees about the effect of this method
|
||||
+ * as such depends on the entity and its state.
|
||||
+ */
|
||||
+ @org.jetbrains.annotations.ApiStatus.Experimental
|
||||
+ void completeUsingActiveItem();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the item being actively "used" or consumed.
|
||||
+ *
|
||||
+ * @return the item
|
||||
|
Reference in New Issue
Block a user