1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-18 11:22:15 +01:00

Add API for item entity health

This commit is contained in:
Jake Potrebic 2021-08-28 09:00:35 -07:00
parent dd15ee83b2
commit fce89ee047

View file

@ -133,5 +133,24 @@ 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
}