Package org.bukkit.entity
Interface Damageable
- All Superinterfaces:
- CommandSender,- Entity,- Metadatable,- Nameable,- Permissible,- PersistentDataHolder,- ServerOperator
- All Known Subinterfaces:
- AbstractHorse,- AbstractSkeleton,- AbstractVillager,- Ageable,- Allay,- Ambient,- Animals,- ArmorStand,- Axolotl,- Bat,- Bee,- Blaze,- Breedable,- Cat,- CaveSpider,- ChestedHorse,- Chicken,- Cod,- ComplexLivingEntity,- Cow,- Creature,- Creeper,- Dolphin,- Donkey,- Drowned,- ElderGuardian,- EnderDragon,- EnderDragonPart,- Enderman,- Endermite,- Evoker,- Fish,- Flying,- Fox,- Frog,- Ghast,- Giant,- GlowSquid,- Goat,- Golem,- Guardian,- Hoglin,- Horse,- HumanEntity,- Husk,- Illager,- Illusioner,- IronGolem,- LivingEntity,- Llama,- MagmaCube,- Mob,- Monster,- Mule,- MushroomCow,- NPC,- Ocelot,- Panda,- Parrot,- Phantom,- Pig,- Piglin,- PiglinAbstract,- PiglinBrute,- PigZombie,- Pillager,- Player,- PolarBear,- PufferFish,- Rabbit,- Raider,- Ravager,- Salmon,- Sheep,- Shulker,- Silverfish,- Skeleton,- SkeletonHorse,- Slime,- Snowman,- Spellcaster,- Spider,- Squid,- Steerable,- Stray,- Strider,- Tadpole,- Tameable,- TraderLlama,- TropicalFish,- Turtle,- Vex,- Villager,- Vindicator,- WanderingTrader,- Warden,- WaterMob,- Witch,- Wither,- WitherSkeleton,- Wolf,- Zoglin,- Zombie,- ZombieHorse,- ZombieVillager
Represents an 
Entity that has health and can take damage.- 
Nested Class SummaryNested classes/interfaces inherited from interface org.bukkit.entity.EntityEntity.Spigot
- 
Method SummaryModifier and TypeMethodDescriptionvoiddamage(double amount) Deals the given amount of damage to this entity.voidDeals the given amount of damage to this entity, from a specified entity.doubleGets the entity's absorption amount.doubleGets the entity's health from 0 togetMaxHealth(), where 0 is dead.doubleDeprecated.voidDeprecated.voidsetAbsorptionAmount(double amount) Sets the entity's absorption amount.voidsetHealth(double health) Sets the entity's health from 0 togetMaxHealth(), where 0 is dead.voidsetMaxHealth(double health) Deprecated.Methods inherited from interface org.bukkit.command.CommandSendergetName, sendMessage, sendMessage, sendMessage, sendMessageMethods inherited from interface org.bukkit.entity.EntityaddPassenger, addScoreboardTag, eject, getBoundingBox, getEntityId, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFrozen, isGlowing, isInsideVehicle, isInvulnerable, isInWater, isOnGround, isPersistent, isSilent, isValid, isVisualFire, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisualFire, spigot, teleport, teleport, teleport, teleportMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.NameablegetCustomName, setCustomNameMethods inherited from interface org.bukkit.permissions.PermissibleaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface org.bukkit.permissions.ServerOperatorisOp, setOp
- 
Method Details- 
damagevoid damage(double amount) Deals the given amount of damage to this entity.- Parameters:
- amount- Amount of damage to deal
 
- 
damageDeals the given amount of damage to this entity, from a specified entity.- Parameters:
- amount- Amount of damage to deal
- source- Entity which to attribute this damage from
 
- 
getHealthdouble getHealth()Gets the entity's health from 0 togetMaxHealth(), where 0 is dead.- Returns:
- Health represented from 0 to max
 
- 
setHealthvoid setHealth(double health) Sets the entity's health from 0 togetMaxHealth(), where 0 is dead.- Parameters:
- health- New health represented from 0 to max
- Throws:
- IllegalArgumentException- Thrown if the health is < 0 or >- getMaxHealth()
 
- 
getAbsorptionAmountdouble getAbsorptionAmount()Gets the entity's absorption amount.- Returns:
- absorption amount from 0
 
- 
setAbsorptionAmountvoid setAbsorptionAmount(double amount) Sets the entity's absorption amount.- Parameters:
- amount- new absorption amount from 0
- Throws:
- IllegalArgumentException- thrown if health is < 0 or non-finite.
 
- 
getMaxHealthDeprecated.Gets the maximum health this entity has.- Returns:
- Maximum health
 
- 
setMaxHealthDeprecated.Sets the maximum health this entity can have.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.- Parameters:
- health- amount of health to set the maximum to
 
- 
resetMaxHealthDeprecated.Resets the max health to the original amount.
 
- 
Attribute.GENERIC_MAX_HEALTH.