public interface Damageable extends Entity
Entity that has health and can take damage.Entity.Spigot| Modifier and Type | Method and Description |
|---|---|
void |
damage(double amount)
Deals the given amount of damage to this entity.
|
void |
damage(double amount,
@Nullable Entity source)
Deals the given amount of damage to this entity, from a specified
entity.
|
void |
damage(double amount,
EntityDamageEvent.DamageCause cause)
Deals the given amount of damage to this entity, with a specified cause.
|
void |
damage(double amount,
@Nullable Entity source,
EntityDamageEvent.DamageCause cause)
Deals the given amount of damage to this entity, from a specified entity,
with a specified cause.
|
double |
getAbsorptionAmount()
Gets the entity's absorption amount.
|
double |
getHealth()
Gets the entity's health from 0 to
getMaxHealth(), where 0 is dead. |
double |
getMaxHealth()
Deprecated.
|
void |
resetMaxHealth()
Deprecated.
|
void |
setAbsorptionAmount(double amount)
Sets the entity's absorption amount.
|
void |
setHealth(double health)
Sets the entity's health from 0 to
getMaxHealth(), where 0 is
dead. |
void |
setMaxHealth(double health)
Deprecated.
|
addPassenger, addScoreboardTag, asHoverEvent, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getTicksLived, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isGlowing, isInBubbleColumn, isInLava, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isValid, leaveVehicle, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, spigot, teleport, teleport, teleport, teleport, teleportAsync, teleportAsyncgetMetadata, hasMetadata, removeMetadata, setMetadatagetName, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageaudience, audience, clearTitle, empty, hideBossBar, openBook, openBook, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, showBossBar, showTitle, stopSound, toAudienceaddAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, recalculatePermissions, removeAttachmentisOp, setOpcustomName, customName, getCustomName, setCustomNamegetPersistentDataContainervoid damage(double amount)
amount - Amount of damage to dealvoid damage(double amount,
@Nullable
@Nullable Entity source)
amount - Amount of damage to dealsource - Entity which to attribute this damage fromvoid damage(double amount,
@NotNull
EntityDamageEvent.DamageCause cause)
amount - Amount of damage to dealcause - Cause of the damagevoid damage(double amount,
@Nullable
@Nullable Entity source,
@NotNull
EntityDamageEvent.DamageCause cause)
amount - Amount of damage to dealsource - Entity which to attribute this damage fromcause - Cause of the damagedouble getHealth()
getMaxHealth(), where 0 is dead.void setHealth(double health)
getMaxHealth(), where 0 is
dead.health - New health represented from 0 to maxIllegalArgumentException - Thrown if the health is < 0 or >
getMaxHealth()double getAbsorptionAmount()
void setAbsorptionAmount(double amount)
amount - new absorption amount from 0IllegalArgumentException - thrown if health is < 0 or
non-finite.@Deprecated double getMaxHealth()
Attribute.GENERIC_MAX_HEALTH.@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 resetMaxHealth()
Attribute.GENERIC_MAX_HEALTH.Copyright © 2021. All rights reserved.