Interface DamageableSkin

All Superinterfaces:
HologramSkin
All Known Subinterfaces:
ArmorStandHologramSkin, LivingEntityHologramSkin, NPCHologramSkin

public interface DamageableSkin extends HologramSkin
Certain skin types have heatlh and may receive damage.
  • Method Details

    • getDamageSound

      @Nullable @Nullable VarSound 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

      @Nullable @Nullable VarSound 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. Stays false 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 -