Interface DamageType

All Superinterfaces:
Keyed, Translatable

@Experimental public interface DamageType extends Keyed, Translatable
Represent a type of damage that an entity can receive.

Constants in this class include the base types provided by the vanilla server. Data packs are capable of registering more types of damage which may be obtained through the Registry.DAMAGE_TYPE.

See Also:
  • Field Details Link icon

  • Method Details Link icon

    • getTranslationKey Link icon

      @NotNull String getTranslationKey()
      Get the translation key, suitable for use in a translation component.

      The returned key is that of the death message sent when this damage type is responsible for the death of an entity.

      Note This translation key is only used if getDeathMessageType() is DeathMessageType.DEFAULT

      Specified by:
      getTranslationKey in interface Translatable
      Returns:
      the translation key
    • getDamageScaling Link icon

      @NotNull DamageScaling getDamageScaling()
      Get the DamageScaling for this damage type.
      Returns:
      the damage scaling
    • getDamageEffect Link icon

      @NotNull DamageEffect getDamageEffect()
      Get the DamageEffect for this damage type.
      Returns:
      the damage effect
    • getDeathMessageType Link icon

      @NotNull DeathMessageType getDeathMessageType()
      Get the DeathMessageType for this damage type.
      Returns:
      the death message type
    • getExhaustion Link icon

      float getExhaustion()
      Get the amount of hunger exhaustion caused by this damage type.
      Returns:
      the exhaustion