Interface DamageCalculationEvent

All Superinterfaces:
Cancellable, Event
All Known Subinterfaces:
AttackEntityEvent, AttackEntityEvent.Post, AttackEntityEvent.Pre, DamageCalculationEvent.Post, DamageCalculationEvent.Pre, DamageEntityEvent, DamageEntityEvent.Post, DamageEntityEvent.Pre
All Known Implementing Classes:
AbstractDamageCalculationEventPre, AbstractDamageEntityEventPost

public interface DamageCalculationEvent extends Event, Cancellable
The base event for when some damage is calculated, whether it is the damage output of an attack, or the damage inflicted to an entity.

The damage calculation starts with a base damage which is modified by a series of operations to obtain a final value. Some of these operations are captured as DamageSteps and are modifiable.

Optimally, these steps can be traced to a particular object, be it an ItemStack, Difficulty, or simply an attribute. Given that Cause has a unique capability of storing any and every Object willing to be passed into it, we can easily represent these "sources" of "steps" in a Cause. Now, knowing the "source" will not provide enough information, so a DamageStepType is provided with a DamageStep to paint the fullest picture of "explaining" the DamageStep as to why it is present, and why it is modifying the base damage.

  • Method Details

    • entity

      Entity entity()
      Gets the targeted Entity.
      Returns:
      The targeted entity
    • baseDamage

      double baseDamage()
      Gets the base damage to deal to the targeted Entity. The base damage is the value before the calculation and its DamageSteps. To modify the base damage, add a modifier to the step associated to DamageStepTypes.START.
      Returns:
      The base damage