Interface DamageType
- All Superinterfaces:
DefaultedRegistryValue
,Nameable
,Taggable<DamageType>
@CatalogedBy(DamageTypes.class)
public interface DamageType
extends DefaultedRegistryValue, Nameable, Taggable<DamageType>
A
DamageType
is a type of "grouping" for DamageSource
s since a DamageSource
instance can be inherently different from
another DamageSource
by virtue of the Object
backing the source. Furthermore, it is impossible to refer to DamageSource
s
statically due to the nature of constructing them. It is possible however, that the parent Object
being referred to as the "damage source"
can damage an Entity
with varying DamageType
s depending on the circumstances.-
Method Summary
Modifier and TypeMethodDescriptioneffect()
Returns the damage effect.double
Gets the amount of exhaustion thisDamageType
will add to the entity, generally only to players.boolean
is
(Tag<DamageType> tag) Checks whether this damage types matches a damage type tag.scaling()
Returns the damage scaling.Methods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
Methods inherited from interface org.spongepowered.api.tag.Taggable
registryType, tags
-
Method Details
-
exhaustion
double exhaustion()Gets the amount of exhaustion thisDamageType
will add to the entity, generally only to players.TODO check this facts:
In vanilla gameplay this is set to 0.1 by default and overridden to 0 if the type is set to be absolute or as overriding armor.
- Returns:
- The increase in exhaustion
-
is
Checks whether this damage types matches a damage type tag.- Specified by:
is
in interfaceTaggable<DamageType>
- Parameters:
tag
- The tag to check.- Returns:
- true if this damage type matches the damage type tag.
-
scaling
DamageScaling scaling()Returns the damage scaling.- Returns:
- the damage scaling
-
effect
DamageEffect effect()Returns the damage effect.- Returns:
- the damage effect
-