类 LivingDamageEvent.Pre
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.Pre
- 封闭类:
LivingDamageEvent
LivingDamageEvent.Pre is fired when an Entity is set to be hurt.
At this point armor, and potion modifiers have already been applied to the damage value and the entity. Absorption modifiers are handled after this event.
This event is fired in
For custom posting of this event, the event expects to be fired after damage reductions have been calculated but before any changes to the entity health has been applied. This event expects a mutable
This event is fired via the
At this point armor, and potion modifiers have already been applied to the damage value and the entity. Absorption modifiers are handled after this event.
This event is fired in
LivingEntity#actuallyHurt(DamageSource, float
For custom posting of this event, the event expects to be fired after damage reductions have been calculated but before any changes to the entity health has been applied. This event expects a mutable
DamageContainer
.
This event is fired via the
CommonHooks.onLivingDamagePre(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
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明返回 theDamageContainer
instance for this damage sequence。float
返回 the current value to be applied to the entity's health after this event。float
返回 the original damage amount from the damage source。返回 the damage source for this damage sequence。void
setNewDamage
(float newDamage) Sets the amount to reduce the entity health by从类继承的方法 net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
-
字段详细资料
-
container
-
-
构造器详细资料
-
Pre
-
-
方法详细资料
-
getContainer
返回 theDamageContainer
instance for this damage sequence。- 返回:
- the
DamageContainer
instance for this damage sequence
-
getSource
返回 the damage source for this damage sequence。- 返回:
- the damage source for this damage sequence
-
getNewDamage
public float getNewDamage()返回 the current value to be applied to the entity's health after this event。- 返回:
- the current value to be applied to the entity's health after this event
-
getOriginalDamage
public float getOriginalDamage()返回 the original damage amount from the damage source。- 返回:
- the original damage amount from the damage source
-
setNewDamage
public void setNewDamage(float newDamage) Sets the amount to reduce the entity health by- 参数:
newDamage
- the new damage value
-