Interface DamageType
- All Superinterfaces:
DataPackSerializable,DefaultedRegistryValue<DamageType>,Nameable,Taggable<DamageType>
@CatalogedBy(DamageTypes.class)
public interface DamageType
extends DefaultedRegistryValue<DamageType>, Nameable, Taggable<DamageType>, DataPackSerializable
A
DamageType is a type of "grouping" for DamageSources 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 DamageSources
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 DamageTypes depending on the circumstances.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic DamageType.Builderbuilder()Creates a newDamageType.Builderto create aDamageType.effect()Returns the damage effect.doubleGets the amount of exhaustion thisDamageTypewill add to the entity, generally only to players.scaling()Returns the damage scaling.Methods inherited from interface org.spongepowered.api.datapack.DataPackSerializable
toDataPackMethods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
builder
Creates a newDamageType.Builderto create aDamageType.- Returns:
- The new builder
-
exhaustion
double exhaustion()Gets the amount of exhaustion thisDamageTypewill 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
-
scaling
DamageScaling scaling()Returns the damage scaling.- Returns:
- the damage scaling
-
effect
DamageEffect effect()Returns the damage effect.- Returns:
- the damage effect
-