Skip to content

DamageSystems.ApplyDamage

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

public static class DamageSystems.ApplyDamage extends DamageEventSystem implements EntityStatsSystems.StatModifyingSystem

The core damage application system. Runs after the gather and filter groups and before the inspect group. Rounds the final damage amount, subtracts it from the entity’s health stat, and triggers death (by adding a DeathComponent) if health reaches the minimum. Cancels damage if the entity is already dead.

public void handle(int index, @Nonnull ArchetypeChunk<EntityStore> archetypeChunk, @Nonnull Store<EntityStore> store, @Nonnull CommandBuffer<EntityStore> commandBuffer, @Nonnull Damage damage)

If the entity already has a DeathComponent, cancels the damage. Otherwise rounds the amount to a whole number, subtracts from health, and adds a DeathComponent if health drops to the minimum.

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