|
||||||||||
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 |
_INVALID_damage(int amount)
Deprecated. |
void |
_INVALID_damage(int amount,
Entity source)
Deprecated. |
int |
_INVALID_getHealth()
Deprecated. |
int |
_INVALID_getMaxHealth()
Deprecated. |
void |
_INVALID_setHealth(int health)
Deprecated. |
void |
_INVALID_setMaxHealth(int health)
Deprecated. |
void |
damage(double amount)
Deals the given amount of damage to this entity. |
void |
damage(double amount,
Entity source)
Deals the given amount of damage to this entity, from a specified entity. |
double |
getHealth()
Gets the entity's health from 0 to getMaxHealth() , where 0 is dead. |
double |
getMaxHealth()
Gets the maximum health this entity has. |
void |
resetMaxHealth()
Resets the max health to the original amount. |
void |
setHealth(double health)
Sets the entity's health from 0 to getMaxHealth() , where 0 is dead. |
void |
setMaxHealth(double 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(double amount)
amount
- Amount of damage to deal@Deprecated void _INVALID_damage(int amount)
void damage(double amount, Entity source)
amount
- Amount of damage to dealsource
- Entity which to attribute this damage from@Deprecated void _INVALID_damage(int amount, Entity source)
double getHealth()
getMaxHealth()
, where 0 is dead.
@Deprecated int _INVALID_getHealth()
void setHealth(double health)
getMaxHealth()
, where 0 is dead.
health
- New health represented from 0 to max
IllegalArgumentException
- Thrown if the health is < 0 or > getMaxHealth()
@Deprecated void _INVALID_setHealth(int health)
double getMaxHealth()
@Deprecated int _INVALID_getMaxHealth()
void setMaxHealth(double health)
If the health of the entity is above the value provided it will be set to that value.
Note: An entity with a health bar (Player
, EnderDragon
, Wither
, etc...} will have their bar scaled accordingly.
health
- amount of health to set the maximum to@Deprecated void _INVALID_setMaxHealth(int health)
void resetMaxHealth()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |