Skip to content

DamageCalculatorSystems

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

public class DamageCalculatorSystems

Contains systems and utilities for calculating damage from interaction-based combat. Provides the queueDamageCalculator method that converts a map of relative damage values per cause into an array of Damage events, applying broken weapon penalties when applicable. Also defines the DAMAGE_SEQUENCE meta key used to track sequential hit information on damage events.

FieldTypeDescription
DAMAGE_SEQUENCEMetaKey<DamageCalculatorSystems.DamageSequence>Meta key on the Damage meta registry for attaching sequential hit data.
@Nonnull
public static Damage[] queueDamageCalculator(
@Nonnull World world,
@Nonnull Object2FloatMap<DamageCause> relativeDamage,
@Nonnull Ref<EntityStore> ref,
@Nonnull CommandBuffer<EntityStore> commandBuffer,
@Nonnull Damage.Source source,
@Nullable ItemStack itemInHand
)

Converts a map of DamageCause to relative damage values into an array of Damage events. For each entry, if the cause is PHYSICAL and the item in hand is broken, the damage is reduced by the weapon broken penalty from the world’s gameplay config. All produced damage events have CAN_BE_PREDICTED set to true.

  • Damage — the damage events produced by this calculator
  • DamageCause — damage type keys in the relative damage map
  • DamageModule — registers the SequenceModifier system
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.