Skip to content

Damage.EntitySource

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

public static class Damage.EntitySource implements Damage.Source

A Damage.Source that identifies another entity as the origin of the damage. Holds a reference to the attacker entity in the EntityStore. The death message is derived from the source entity’s DisplayNameComponent, falling back to a generic “unknown” translation.

public EntitySource(@Nonnull Ref<EntityStore> sourceRef)

Creates an entity source with a reference to the attacking entity.

@Nonnull
public Ref<EntityStore> getRef()

Returns the Ref<EntityStore> pointing to the source entity.

@Nonnull
@Override
public Message getDeathMessage(@Nonnull Damage info, @Nonnull Ref<EntityStore> targetRef, @Nonnull ComponentAccessor<EntityStore> componentAccessor)

Returns a localized death message using the source entity’s display name. If the source has a DisplayNameComponent with a non-null display name, it is used as the damageSource parameter in the server.general.killedBy translation. Otherwise falls back to a generic “unknown” message.

FieldTypeModifiersDescription
sourceRefRef<EntityStore>protected finalReference to the attacking entity.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.