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:
parent
dd15ee83b2
commit
fce89ee047
1 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue