mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 15:49:00 +01:00
35 lines
1.2 KiB
Diff
35 lines
1.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
Date: Sat, 28 Aug 2021 09:00:35 -0700
|
|
Subject: [PATCH] Add API for item entity health
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/entity/Item.java
|
|
+++ b/src/main/java/org/bukkit/entity/Item.java
|
|
@@ -0,0 +0,0 @@ public interface Item extends Entity {
|
|
* @param willAge True if the item should age
|
|
*/
|
|
public void setWillAge(boolean willAge);
|
|
+
|
|
+ /**
|
|
+ * Gets the health of item stack.
|
|
+ * <p>
|
|
+ * Currently the default max health is 5.
|
|
+ *
|
|
+ * @return the health
|
|
+ */
|
|
+ public int getHealth();
|
|
+
|
|
+ /**
|
|
+ * Sets the health of the item stack. If the value is non-positive
|
|
+ * the itemstack's normal "on destroy" functionality will be run.
|
|
+ * <p>
|
|
+ * Currently, the default max health is 5.
|
|
+ *
|
|
+ * @param health the health, a non-positive value will destroy the entity
|
|
+ */
|
|
+ public void setHealth(int health);
|
|
// Paper end
|
|
}
|