|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Damageable
Represents an Entity
that has health and can take damage.
Method Summary | |
---|---|
void |
damage(int amount)
Deals the given amount of damage to this entity. |
void |
damage(int amount,
Entity source)
Deals the given amount of damage to this entity, from a specified entity. |
int |
getHealth()
Gets the entity's health from 0 to getMaxHealth() , where 0 is dead. |
int |
getMaxHealth()
Gets the maximum health this entity has. |
void |
resetMaxHealth()
Resets the max health to the original amount. |
void |
setHealth(int health)
Sets the entity's health from 0 to getMaxHealth() , where 0 is dead. |
void |
setMaxHealth(int health)
Sets the maximum health this entity can have. |
Methods inherited from interface org.bukkit.entity.Entity |
---|
eject, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWorld, isDead, isEmpty, isInsideVehicle, isOnGround, isValid, leaveVehicle, playEffect, remove, setFallDistance, setFireTicks, setLastDamageCause, setPassenger, setTicksLived, setVelocity, teleport, teleport, teleport, teleport |
Methods inherited from interface org.bukkit.metadata.Metadatable |
---|
getMetadata, hasMetadata, removeMetadata, setMetadata |
Method Detail |
---|
void damage(int amount)
amount
- Amount of damage to dealvoid damage(int amount, Entity source)
amount
- Amount of damage to dealsource
- Entity which to attribute this damage fromint getHealth()
getMaxHealth()
, where 0 is dead.
void setHealth(int health)
getMaxHealth()
, where 0 is dead.
health
- New health represented from 0 to max
IllegalArgumentException
- Thrown if the health is < 0 or > getMaxHealth()
int getMaxHealth()
void setMaxHealth(int health)
Player
, EnderDragon
, Wither
, etc...} will have their bar scaled accordingly.
health
- amount of health to set the maximum tovoid resetMaxHealth()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |