Enum Class PlayerDamageEvent.Cause
- All Implemented Interfaces:
Serializable
,Comparable<PlayerDamageEvent.Cause>
,Constable
- Enclosing class:
PlayerDamageEvent
Determines why the
PlayerDamageEvent
was triggered exactly
(i.e what's causing the damage).-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionPlayer is bleedingPlayer came in contact with lava or firePlayer is dying of dehydrationPlayer is drowningEnvironmental damage (e.g touching an element that inflicts damage)Player took damage from an explosionPlayer took fall damageAn npc (including animals) attacked this playerAnother player attacked this player.An npc shot on this playerAnother player shot on this playerPlayer is dying of starvationPlayer is exposed to cold temperatures (hypothermia)Player stepped into a trap (e.g spikes)Unknown reason... -
Method Summary
Modifier and TypeMethodDescriptionstatic PlayerDamageEvent.Cause
Returns the enum constant of this class with the specified name.static PlayerDamageEvent.Cause[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Unknown
Unknown reason... you cannot cancel the event in this case -
HitByPlayer
Another player attacked this player.PlayerHitPlayerEvent
is also triggered in this case -
ShotByPlayer
Another player shot on this player -
HitByNpc
An npc (including animals) attacked this player -
ShotByNpc
An npc shot on this player -
Drowning
Player is drowning -
Burning
Player came in contact with lava or fire -
Explosion
Player took damage from an explosion -
FallDamage
Player took fall damage -
Bleeding
Player is bleeding -
Starvation
Player is dying of starvation -
Dehydration
Player is dying of dehydration -
Temperature
Player is exposed to cold temperatures (hypothermia) -
Environment
Environmental damage (e.g touching an element that inflicts damage) -
Trap
Player stepped into a trap (e.g spikes)
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-