Skip to content

Damage.EnvironmentSource

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

public static class Damage.EnvironmentSource implements Damage.Source

A Damage.Source for damage caused by the environment rather than an entity or command. Carries a string type identifier describing the environmental hazard (e.g., lava, fire, thorns).

public EnvironmentSource(@Nonnull String type)

Creates an environment source with the given type identifier.

@Nonnull
public String getType()

Returns the environment type identifier string.

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

Returns a localized death message using the server.general.killedBy translation key, parameterized with the environment type string.

FieldTypeModifiersDescription
typeStringprivate finalThe environment hazard type identifier.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.