@Immutable public interface DamageModifier
DoubleUnaryOperator such that the output will be the final damage
applied to the Entity.| Modifier and Type | Interface and Description |
|---|---|
static class |
DamageModifier.Builder
A builder that creates
DamageModifiers, for use in both plugin and
implementation requirements. |
| Modifier and Type | Method and Description |
|---|---|
static DamageModifier.Builder |
builder()
Creates a new
DamageModifier.Builder for constructing a DamageModifier. |
Cause |
getCause()
Gets the cause of this
DamageModifier. |
Optional<ItemStackSnapshot> |
getContributingItem()
Gets the contributing
ItemStackSnapshot that provided the
"reason" for this DamageModifier to exist. |
DamageModifierType |
getType()
Gets the
DamageModifierType for this DamageModifier. |
static DamageModifier.Builder builder()
DamageModifier.Builder for constructing a DamageModifier.DamageModifierType getType()
DamageModifierType for this DamageModifier.Cause getCause()
DamageModifier.Optional<ItemStackSnapshot> getContributingItem()
ItemStackSnapshot that provided the
"reason" for this DamageModifier to exist. An example of a
contributing ItemStack is if an ItemTypes.DIAMOND_SWORD
provided an Enchantment that provided a
DamageModifierTypes.WEAPON_ENCHANTMENT, this modifier would have
the ItemStackSnapshot for the weapon used. Some modifiers however,
do not require an ItemStack to be the contributing factor for
this modifier to exist.