Damage.EntitySource
Package: com.hypixel.hytale.server.core.modules.entity.damage
public static class Damage.EntitySource implements Damage.SourceA 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.
Constructor
Section titled “Constructor”public EntitySource(@Nonnull Ref<EntityStore> sourceRef)Creates an entity source with a reference to the attacking entity.
Methods
Section titled “Methods”@Nonnullpublic Ref<EntityStore> getRef()Returns the Ref<EntityStore> pointing to the source entity.
@Nonnull@Overridepublic 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.
Fields
Section titled “Fields”| Field | Type | Modifiers | Description |
|---|---|---|---|
sourceRef | Ref<EntityStore> | protected final | Reference to the attacking entity. |
Related Types
Section titled “Related Types”- Damage — the damage event
- Damage.Source — parent interface
- Damage.ProjectileSource — subclass for projectile damage
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.