Damage.Source
Package: com.hypixel.hytale.server.core.modules.entity.damage
public interface Damage.SourceInterface for identifying the origin of a Damage event and generating a localized death message. Implementations include Damage.EntitySource, Damage.ProjectileSource, Damage.CommandSource, and Damage.EnvironmentSource. The null source (Damage.NULL_SOURCE) is an anonymous implementation used for sourceless damage such as fall damage or drowning.
Methods
Section titled “Methods”@Nonnulldefault Message getDeathMessage(@Nonnull Damage info, @Nonnull Ref<EntityStore> targetRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor)Returns a localized death message for the kill feed. The default implementation looks up the DamageCause by index and produces a translation key of the form server.general.killedBy parameterized with the cause name. Implementations override this to provide source-specific messages (e.g., “killed by [player]” or “killed by command”).
Related Types
Section titled “Related Types”- Damage — the damage event that carries a source
- Damage.EntitySource — entity-originated damage
- Damage.CommandSource — command-originated damage
- Damage.EnvironmentSource — environment-originated damage
- DamageCause — asset used in the default death message
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.