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
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 DamageStep
s 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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Fires after the damage steps and their side effects have been applied.static interface
Fires before the damage steps and their side effects are applied. -
Method Summary
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
Method Details
-
entity
Entity entity()Gets the targetedEntity
.- Returns:
- The targeted entity
-
baseDamage
double baseDamage()Gets the base damage to deal to the targetedEntity
. The base damage is the value before the calculation and itsDamageStep
s. To modify the base damage, add a modifier to the step associated toDamageStepTypes.START
.- Returns:
- The base damage
-