Interface Damage.Source

All Known Implementing Classes:
ActiveEntityEffect, Damage.CommandSource, Damage.EntityEffectSource, Damage.EntitySource, Damage.EnvironmentSource, Damage.ProjectileSource
Enclosing class:
Damage

public static interface Damage.Source
Information about the source of a damage event.

Implement to add a new damage source or use one of the existing ones (e.g. Damage.EntitySource.

  • Method Details

    • getDeathMessage

      @Nonnull default Message getDeathMessage(@Nonnull Damage info, @Nonnull Ref<EntityStore> targetRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor)
      Generates a death message from this source and any information provided in info.
      Parameters:
      info - The damage info to inspect
      targetRef - The entity reference of the entity that has been killed.
      componentAccessor - The ComponentAccessor<EntityStore> for component access.
      Returns:
      The generated death message
    • getSourceType

      @Nonnull default DamageSourceType getSourceType()
      Returns:
      the DamageSourceType of this source.