Skip to content

Damage.Source

Package: com.hypixel.hytale.server.core.modules.entity.damage

public interface Damage.Source

Interface 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.

@Nonnull
default 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”).

Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.