Interface DamageModifier
public interface DamageModifier
Represents a modifier that will apply a function on a damage value to deal
towards an entity such that the raw damage is the input of a
DoubleUnaryOperator such that the output will be the final damage
applied to the Entity.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder that createsDamageModifiers, for use in both plugin and implementation requirements. -
Method Summary
Modifier and TypeMethodDescriptionstatic DamageModifier.Builderbuilder()Creates a newDamageModifier.Builderfor constructing aDamageModifier.cause()Gets the cause of thisDamageModifier.Gets the contributingItemStackSnapshotthat provided the "reason" for thisDamageModifierto exist.type()Gets theDamageModifierTypefor thisDamageModifier.
-
Method Details
-
builder
Creates a newDamageModifier.Builderfor constructing aDamageModifier.- Returns:
- A new builder
-
type
DamageModifierType type()Gets theDamageModifierTypefor thisDamageModifier.- Returns:
- The damage modifier type
-
cause
Cause cause()Gets the cause of thisDamageModifier.- Returns:
- The cause of this damage modifier
-
contributingItem
Optional<ItemStackSnapshot> contributingItem()Gets the contributingItemStackSnapshotthat provided the "reason" for thisDamageModifierto exist. An example of a contributingItemStackis if anItemTypes.DIAMOND_SWORDprovided anEnchantmentthat provided aDamageModifierTypes.WEAPON_ENCHANTMENT, this modifier would have theItemStackSnapshotfor the weapon used. Some modifiers however, do not require anItemStackto be the contributing factor for this modifier to exist.- Returns:
- The contributing item, if available
-