Package org.bukkit.event.entity

# Enum Class EntityDamageEvent.DamageCause

java.lang.Object
java.lang.Enum<EntityDamageEvent.DamageCause>
org.bukkit.event.entity.EntityDamageEvent.DamageCause

All Implemented Interfaces:
  `Serializable`, `Comparable<EntityDamageEvent.DamageCause>`, `Constable`

Enclosing class:
  EntityDamageEvent

public static enum EntityDamageEvent.DamageCause extends Enum<EntityDamageEvent.DamageCause>
An enum to specify the cause of the damage

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`BLOCK_EXPLOSION`
Damage caused by being in the area when a block explodes.
`CONTACT`
Damage caused when an entity contacts a block such as a Cactus, Dripstone (Stalagmite) or Berry Bush.
`CRAMMING`
Damage caused when an entity is colliding with too many entities due to the maxEntityCramming game rule.
`CUSTOM`
Custom damage.
`DRAGON_BREATH`
Damage caused by a dragon breathing fire.
`DROWNING`
Damage caused by running out of air while in water
`DRYOUT`
Damage caused when an entity that should be in water is not.
`ENTITY_ATTACK`
Damage caused when an entity attacks another entity.
`ENTITY_EXPLOSION`
Damage caused by being in the area when an entity, such as a Creeper, explodes.
`ENTITY_SWEEP_ATTACK`
Damage caused when an entity attacks another entity in a sweep attack.
`FALL`
Damage caused when an entity falls a distance greater than 3 blocks
`FALLING_BLOCK`
Damage caused by being hit by a falling block which deals damage
`FIRE`
Damage caused by direct exposure to fire
`FIRE_TICK`
Damage caused due to burns caused by fire
`FLY_INTO_WALL`
Damage caused when an entity runs into a wall.
`FREEZE`
Damage caused from freezing.
`HOT_FLOOR`
Damage caused when an entity steps on `Material.MAGMA_BLOCK`.
`LAVA`
Damage caused by direct exposure to lava
`LIGHTNING`
Damage caused by being struck by lightning
`MAGIC`
Damage caused by being hit by a damage potion or spell
`MELTING`
Damage caused due to a snowman melting
`POISON`
Damage caused due to an ongoing poison effect
`PROJECTILE`
Damage caused when attacked by a projectile.
`STARVATION`
Damage caused by starving due to having an empty hunger bar
`SUFFOCATION`
Damage caused by being put in a block
`SUICIDE`
Damage caused by committing suicide.
`THORNS`
Damage caused in retaliation to another attack by the Thorns enchantment.
`VOID`
Damage caused by falling into the void
`WITHER`
Damage caused by Wither potion effect

## Method Summary

Modifier and Type
Method
Description
`static EntityDamageEvent.DamageCause`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static EntityDamageEvent.DamageCause[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

### Methods inherited from class java.lang.Enum

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### CONTACT

public static final EntityDamageEvent.DamageCause CONTACT
Damage caused when an entity contacts a block such as a Cactus, Dripstone (Stalagmite) or Berry Bush.

Damage: variable

### ENTITY_ATTACK

public static final EntityDamageEvent.DamageCause ENTITY_ATTACK
Damage caused when an entity attacks another entity.

Damage: variable

### ENTITY_SWEEP_ATTACK

public static final EntityDamageEvent.DamageCause ENTITY_SWEEP_ATTACK
Damage caused when an entity attacks another entity in a sweep attack.

Damage: variable

### PROJECTILE

public static final EntityDamageEvent.DamageCause PROJECTILE
Damage caused when attacked by a projectile.

Damage: variable

### SUFFOCATION

public static final EntityDamageEvent.DamageCause SUFFOCATION
Damage caused by being put in a block

Damage: 1

### FALL

public static final EntityDamageEvent.DamageCause FALL
Damage caused when an entity falls a distance greater than 3 blocks

Damage: fall height - 3.0

### FIRE

public static final EntityDamageEvent.DamageCause FIRE
Damage caused by direct exposure to fire

Damage: 1

### FIRE_TICK

public static final EntityDamageEvent.DamageCause FIRE_TICK
Damage caused due to burns caused by fire

Damage: 1

### MELTING

public static final EntityDamageEvent.DamageCause MELTING
Damage caused due to a snowman melting

Damage: 1

### LAVA

public static final EntityDamageEvent.DamageCause LAVA
Damage caused by direct exposure to lava

Damage: 4

### DROWNING

public static final EntityDamageEvent.DamageCause DROWNING
Damage caused by running out of air while in water

Damage: 2

### BLOCK_EXPLOSION

public static final EntityDamageEvent.DamageCause BLOCK_EXPLOSION
Damage caused by being in the area when a block explodes.

Damage: variable

### ENTITY_EXPLOSION

public static final EntityDamageEvent.DamageCause ENTITY_EXPLOSION
Damage caused by being in the area when an entity, such as a Creeper, explodes.

Damage: variable

### VOID

public static final EntityDamageEvent.DamageCause VOID
Damage caused by falling into the void

Damage: 4 for players

### LIGHTNING

public static final EntityDamageEvent.DamageCause LIGHTNING
Damage caused by being struck by lightning

Damage: 5

### SUICIDE

public static final EntityDamageEvent.DamageCause SUICIDE
Damage caused by committing suicide.

Note: This is currently only used by plugins, default commands like /minecraft:kill use `VOID` to damage players.

Damage: variable

### STARVATION

public static final EntityDamageEvent.DamageCause STARVATION
Damage caused by starving due to having an empty hunger bar

Damage: 1

### POISON

public static final EntityDamageEvent.DamageCause POISON
Damage caused due to an ongoing poison effect

Damage: 1

### MAGIC

public static final EntityDamageEvent.DamageCause MAGIC
Damage caused by being hit by a damage potion or spell

Damage: variable

### WITHER

public static final EntityDamageEvent.DamageCause WITHER
Damage caused by Wither potion effect

### FALLING_BLOCK

public static final EntityDamageEvent.DamageCause FALLING_BLOCK
Damage caused by being hit by a falling block which deals damage

Note: Not every block deals damage

Damage: variable

### THORNS

public static final EntityDamageEvent.DamageCause THORNS
Damage caused in retaliation to another attack by the Thorns enchantment.

Damage: 1-4 (Thorns)

### DRAGON_BREATH

public static final EntityDamageEvent.DamageCause DRAGON_BREATH
Damage caused by a dragon breathing fire.

Damage: variable

### CUSTOM

public static final EntityDamageEvent.DamageCause CUSTOM
Custom damage.

Damage: variable

### FLY_INTO_WALL

public static final EntityDamageEvent.DamageCause FLY_INTO_WALL
Damage caused when an entity runs into a wall.

Damage: variable

### HOT_FLOOR

public static final EntityDamageEvent.DamageCause HOT_FLOOR
Damage caused when an entity steps on `Material.MAGMA_BLOCK`.

Damage: 1

### CRAMMING

public static final EntityDamageEvent.DamageCause CRAMMING
Damage caused when an entity is colliding with too many entities due to the maxEntityCramming game rule.

Damage: 6

### DRYOUT

public static final EntityDamageEvent.DamageCause DRYOUT
Damage caused when an entity that should be in water is not.

Damage: 1

### FREEZE

public static final EntityDamageEvent.DamageCause FREEZE
Damage caused from freezing.

Damage: 1 or 5

## Method Details

### values

public static EntityDamageEvent.DamageCause[] 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

public static EntityDamageEvent.DamageCause valueOf(String name)
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 name
  `NullPointerException` - if the argument is null