CommandSender
, Entity
, Metadatable
, Nameable
, Permissible
, ServerOperator
AbstractHorse
, Ageable
, Ambient
, Animals
, ArmorStand
, Bat
, Blaze
, CaveSpider
, ChestedHorse
, Chicken
, ComplexLivingEntity
, Cow
, Creature
, Creeper
, Donkey
, ElderGuardian
, EnderDragon
, EnderDragonPart
, Enderman
, Endermite
, Evoker
, Flying
, Ghast
, Giant
, Golem
, Guardian
, Horse
, HumanEntity
, Husk
, IronGolem
, LivingEntity
, Llama
, MagmaCube
, Monster
, Mule
, MushroomCow
, NPC
, Ocelot
, Pig
, PigZombie
, Player
, PolarBear
, Rabbit
, Sheep
, Shulker
, Silverfish
, Skeleton
, SkeletonHorse
, Slime
, Snowman
, Spider
, Squid
, Stray
, Vex
, Villager
, Vindicator
, WaterMob
, Witch
, Wither
, WitherSkeleton
, Wolf
, Zombie
, ZombieHorse
, ZombieVillager
public interface Damageable extends Entity
Entity
that has health and can take damage.Modifier and Type | Method | Description |
---|---|---|
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() |
Deprecated.
|
void |
resetMaxHealth() |
Deprecated.
|
void |
setHealth(double health) |
Sets the entity's health from 0 to
getMaxHealth() , where 0 is
dead. |
void |
setMaxHealth(double health) |
Deprecated.
|
getName, sendMessage, sendMessage
addPassenger, addScoreboardTag, eject, getEntityId, getFallDistance, getFireTicks, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getPassenger, getPassengers, getPortalCooldown, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInsideVehicle, isInvulnerable, isOnGround, isSilent, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPortalCooldown, setSilent, setTicksLived, setVelocity, teleport, teleport, teleport, teleport
getMetadata, hasMetadata, removeMetadata, setMetadata
getCustomName, setCustomName
addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachment
isOp, setOp
void damage(double amount)
amount
- Amount of damage to deal@Deprecated void _INVALID_damage(int amount)
amount
- Amount of damage to dealvoid 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)
amount
- Amount of damage to dealsource
- Entity which to attribute this damage fromdouble 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 maxjava.lang.IllegalArgumentException
- Thrown if the health is < 0 or >
getMaxHealth()
@Deprecated void _INVALID_setHealth(int health)
health
- New health represented from 0 to maxjava.lang.IllegalArgumentException
- Thrown if the health is < 0 or >
getMaxHealth()
@Deprecated double getMaxHealth()
Attribute.GENERIC_MAX_HEALTH
.@Deprecated int _INVALID_getMaxHealth()
@Deprecated void setMaxHealth(double health)
Attribute.GENERIC_MAX_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)
health
- amount of health to set the maximum to@Deprecated void resetMaxHealth()
Attribute.GENERIC_MAX_HEALTH
.