Interface DamageableSkin
- All Superinterfaces:
HologramSkin
- All Known Subinterfaces:
ArmorStandHologramSkin,LivingEntityHologramSkin,NPCHologramSkin
Certain skin types have heatlh and may receive damage.
-
Method Summary
Modifier and TypeMethodDescriptionvoidattack(float damage) Decreases the amount of health by a given amount and plays animation and sound.@Nullable VarSoundGet the sound that will be played when it is being attacked.@Nullable VarSoundGet the sound that will be played when it died.floatGet the amount of heatlh that the entity currently has.booleansetHealth(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
nullif 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
nullif 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:
truewhether the new amount caused the hologram to die. Staysfalseif 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-
-