Interface DamageableSkin
- All Superinterfaces:
HologramSkin
- All Known Subinterfaces:
ArmorStandHologramSkin
,LivingEntityHologramSkin
,NPCHologramSkin
Certain skin types have heatlh and may receive damage.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attack
(float damage) Decreases the amount of health by a given amount and plays animation and sound.@Nullable VarSound
Get the sound that will be played when it is being attacked.@Nullable VarSound
Get the sound that will be played when it died.float
Get the amount of heatlh that the entity currently has.boolean
setHealth
(float health) Change the amount of health.Methods inherited from interface de.marcely.bedwars.api.world.hologram.HologramSkin
getEntityId, getEntityType, getHologram, getNMSEntity, getType
-
Method Details
-
getDamageSound
Get the sound that will be played when it is being attacked.- Returns:
- The sound that will be played when the hologram receives damage. May be
null
if none shall be played
-
getDeathSound
Get the sound that will be played when it died.- Returns:
- The sound that will be played when the hologram dies. May be
null
if none shall be played
-
getHealth
float getHealth()Get the amount of heatlh that the entity currently has.- Returns:
- The amount of heatlh he has
-
setHealth
boolean setHealth(float health) Change the amount of health.Setting it to 0 or less kills and removes the hologram. While no sound or animation is played when the health decreases, one is being played if the change caused the hologram to die.
- Parameters:
health
- The new health amount. 0 or less to kill it- Returns:
true
whether the new amount caused the hologram to die. Staysfalse
if the hologram was already dead
-
attack
void attack(float damage) Decreases the amount of health by a given amount and plays animation and sound.Death animation and sound is being played if the new health is 0 or less.
- Parameters:
damage
-
-