Package net.risingworld.api.events.npc
Enum Class NpcDamageEvent.Cause
- All Implemented Interfaces:
Serializable
,Comparable<NpcDamageEvent.Cause>
,Constable
- Enclosing class:
NpcDamageEvent
Determines why the
NpcDamageEvent
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 ConstantDescriptionNpc came in contact with lava or fireNpc is dying of dehydrationNpc is drowningEnvironmental damage (e.g touching an element that inflicts damage)Npc took damage from an explosionNpc took fall damageAnother npc attacked this npc.A player attacked this npc.A player shot this npcNpc is dying of starvationNpc is exposed to cold temperatures (hypothermia)Npc stepped into a trap (e.g spikes)Unknown reason... -
Method Summary
Modifier and TypeMethodDescriptionstatic NpcDamageEvent.Cause
Returns the enum constant of this class with the specified name.static NpcDamageEvent.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
A player attacked this npc.PlayerHitNpcEvent
is also triggered in this case -
ShotByPlayer
A player shot this npc -
HitByNpc
Another npc attacked this npc.NpcHitNpcEvent
is also triggered in this case -
Drowning
Npc is drowning -
Burning
Npc came in contact with lava or fire -
Explosion
Npc took damage from an explosion -
FallDamage
Npc took fall damage -
Starvation
Npc is dying of starvation -
Dehydration
Npc is dying of dehydration -
Temperature
Npc is exposed to cold temperatures (hypothermia) -
Environment
Environmental damage (e.g touching an element that inflicts damage) -
Trap
Npc 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
-