类 LivingDamageEvent.Post
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.living.LivingDamageEvent
net.neoforged.neoforge.event.entity.living.LivingDamageEvent.Post
- 封闭类:
LivingDamageEvent
LivingDamageEvent.Post is fired after health is modified on the entity.
The fields in this event represent the FINAL values of what was applied to the entity.
Also note that appropriate resources (like armor durability and absorption extra hearts) have already been consumed.
This event is fired whenever an Entity is damaged in
This event is fired via
The fields in this event represent the FINAL values of what was applied to the entity.
Also note that appropriate resources (like armor durability and absorption extra hearts) have already been consumed.
This event is fired whenever an Entity is damaged in
LivingEntity#actuallyHurt(DamageSource, float)
This event is fired via
CommonHooks.onLivingDamagePost(LivingEntity, DamageContainer)
.- 另请参阅:
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.living.LivingDamageEvent
LivingDamageEvent.Post, LivingDamageEvent.Pre
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
字段概要
字段修饰符和类型字段说明private final float
private final float
private final float
private final int
private final EnumMap
<DamageContainer.Reduction, Float> private final float
private final DamageSource
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明float
返回 the amount of damage reduced by a blocking action。float
返回 the amount of health this entity lost during this sequence。float
返回 the original damage whenEntity.hurt(net.minecraft.world.damagesource.DamageSource, float)
was invoked。int
返回 the number of ticks this entity will be invulnerable after this sequence。float
getReduction
(DamageContainer.Reduction reduction) float
返回 the amount of shield durability this entity lost if a blocking action was captured and the entity was holding a shield。返回 theDamageSource
for this damage sequence。从类继承的方法 net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
-
字段详细资料
-
originalDamage
private final float originalDamage -
source
-
newDamage
private final float newDamage -
blockedDamage
private final float blockedDamage -
shieldDamage
private final float shieldDamage -
postAttackInvulnerabilityTicks
private final int postAttackInvulnerabilityTicks -
reductions
-
-
构造器详细资料
-
Post
-
-
方法详细资料
-
getOriginalDamage
public float getOriginalDamage()返回 the original damage whenEntity.hurt(net.minecraft.world.damagesource.DamageSource, float)
was invoked。- 返回:
- the original damage when
Entity.hurt(net.minecraft.world.damagesource.DamageSource, float)
was invoked
-
getSource
返回 theDamageSource
for this damage sequence。- 返回:
- the
DamageSource
for this damage sequence
-
getNewDamage
public float getNewDamage()返回 the amount of health this entity lost during this sequence。- 返回:
- the amount of health this entity lost during this sequence
-
getBlockedDamage
public float getBlockedDamage()返回 the amount of damage reduced by a blocking action。- 返回:
- the amount of damage reduced by a blocking action
-
getShieldDamage
public float getShieldDamage()返回 the amount of shield durability this entity lost if a blocking action was captured and the entity was holding a shield。- 返回:
- the amount of shield durability this entity lost if a blocking action was captured and the entity was holding a shield
-
getPostAttackInvulnerabilityTicks
public int getPostAttackInvulnerabilityTicks()返回 the number of ticks this entity will be invulnerable after this sequence。- 返回:
- the number of ticks this entity will be invulnerable after this sequence
-
getReduction
- 参数:
reduction
- the type of reduction to obtain- 返回:
- the amount of damage reduced by this reduction type.
-