枚举 EntityDamageEvent.DamageCause
- 所有已实现的接口:
Serializable
,Comparable<EntityDamageEvent.DamageCause>
,java.lang.constant.Constable
- 封闭类:
- EntityDamageEvent
An enum to specify the cause of the damage
-
嵌套类概要
从类继承的嵌套类/接口 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
枚举常量概要
枚举常量说明Damage caused by being in the area when a block explodes.Damage caused when an entity contacts a block such as a Cactus.Damage caused when an entity is colliding with too many entities due to the maxEntityCramming game rule.Custom damage.Damage caused by a dragon breathing fire.Damage caused by running out of air while in waterDamage caused when an entity attacks another entity.Damage caused by being in the area when an entity, such as a Creeper, explodes.Damage caused when an entity attacks another entity in a sweep attack.Damage caused when an entity falls a distance greater than 3 blocksDamage caused by being hit by a falling block which deals damageDamage caused by direct exposure to fireDamage caused due to burns caused by fireDamage caused when an entity runs into a wall.Damage caused when an entity steps onMaterial.MAGMA
.Damage caused by direct exposure to lavaDamage caused by being struck by lightningDamage caused by being hit by a damage potion or spellDamage caused due to a snowman meltingDamage caused due to an ongoing poison effectDamage caused when attacked by a projectile.Damage caused by starving due to having an empty hunger barDamage caused by being put in a blockDamage caused by committing suicide using the command "/kill"Damage caused in retaliation to another attack by the Thorns enchantment.Damage caused by falling into the voidDamage caused by Wither potion effect -
方法概要
修饰符和类型方法说明返回带有指定名称的该类型的枚举常量。static EntityDamageEvent.DamageCause[]
values()
按照声明该枚举类型的常量的顺序, 返回一个包含这些常量的数组。
-
枚举常量详细资料
-
CONTACT
Damage caused when an entity contacts a block such as a Cactus.Damage: 1 (Cactus)
-
ENTITY_ATTACK
Damage caused when an entity attacks another entity.Damage: variable
-
ENTITY_SWEEP_ATTACK
Damage caused when an entity attacks another entity in a sweep attack.Damage: variable
-
PROJECTILE
Damage caused when attacked by a projectile.Damage: variable
-
SUFFOCATION
Damage caused by being put in a blockDamage: 1
-
FALL
Damage caused when an entity falls a distance greater than 3 blocksDamage: fall height - 3.0
-
FIRE
Damage caused by direct exposure to fireDamage: 1
-
FIRE_TICK
Damage caused due to burns caused by fireDamage: 1
-
MELTING
Damage caused due to a snowman meltingDamage: 1
-
LAVA
Damage caused by direct exposure to lavaDamage: 4
-
DROWNING
Damage caused by running out of air while in waterDamage: 2
-
BLOCK_EXPLOSION
Damage caused by being in the area when a block explodes.Damage: variable
-
ENTITY_EXPLOSION
Damage caused by being in the area when an entity, such as a Creeper, explodes.Damage: variable
-
VOID
Damage caused by falling into the voidDamage: 4 for players
-
LIGHTNING
Damage caused by being struck by lightningDamage: 5
-
SUICIDE
Damage caused by committing suicide using the command "/kill"Damage: 1000
-
STARVATION
Damage caused by starving due to having an empty hunger barDamage: 1
-
POISON
Damage caused due to an ongoing poison effectDamage: 1
-
MAGIC
Damage caused by being hit by a damage potion or spellDamage: variable
-
WITHER
Damage caused by Wither potion effect -
FALLING_BLOCK
Damage caused by being hit by a falling block which deals damageNote: Not every block deals damage
Damage: variable
-
THORNS
Damage caused in retaliation to another attack by the Thorns enchantment.Damage: 1-4 (Thorns)
-
DRAGON_BREATH
Damage caused by a dragon breathing fire.Damage: variable
-
CUSTOM
Custom damage.Damage: variable
-
FLY_INTO_WALL
Damage caused when an entity runs into a wall.Damage: variable
-
HOT_FLOOR
Damage caused when an entity steps onMaterial.MAGMA
.Damage: 1
-
CRAMMING
Damage caused when an entity is colliding with too many entities due to the maxEntityCramming game rule.Damage: 6
-
-
方法详细资料
-
values
按照声明该枚举类型的常量的顺序, 返回一个包含这些常量的数组。- 返回:
- 按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
-
valueOf
返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)- 参数:
name
- 要返回的枚举常量的名称。- 返回:
- 返回带有指定名称的枚举常量
- 抛出:
IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量NullPointerException
- 如果参数为空值
-