Interface DamageModifier
-
public interface DamageModifierRepresents 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 aDoubleUnaryOperatorsuch that the output will be the final damage applied to theEntity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDamageModifier.BuilderA builder that createsDamageModifiers, for use in both plugin and implementation requirements.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static DamageModifier.Builderbuilder()Creates a newDamageModifier.Builderfor constructing aDamageModifier.Causecause()Gets the cause of thisDamageModifier.Optional<ItemStackSnapshot>contributingItem()Gets the contributingItemStackSnapshotthat provided the "reason" for thisDamageModifierto exist.DamageModifierTypetype()Gets theDamageModifierTypefor thisDamageModifier.
-
-
-
Method Detail
-
builder
static DamageModifier.Builder 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
-
-