类 EntityInvulnerabilityCheckEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.EntityInvulnerabilityCheckEvent
Fired when
is invoked and determines if
downstream hurt logic should apply. This event is fired on both sides in
Note: This event may be unable to change the invulnerable status of some entities that override isInvulnerableTo against certain damage sources
引用无效
Entity#isInvulnerableTo(DamageSource)
引用无效
Entity#isInvulnerableTo(DamageSource)
Note: This event may be unable to change the invulnerable status of some entities that override isInvulnerableTo against certain damage sources
-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
字段概要
字段 -
构造器概要
构造器构造器说明EntityInvulnerabilityCheckEvent
(Entity entity, DamageSource source, boolean isVanillaInvulnerable) -
方法概要
修饰符和类型方法说明boolean
boolean
void
setInvulnerable
(boolean isInvulnerable) Sets the invulnerable status of the entity.从类继承的方法 net.neoforged.neoforge.event.entity.EntityEvent
getEntity
-
字段详细资料
-
originallyInvulnerable
private final boolean originallyInvulnerable -
isInvulnerable
private boolean isInvulnerable -
source
-
-
构造器详细资料
-
EntityInvulnerabilityCheckEvent
@Internal public EntityInvulnerabilityCheckEvent(Entity entity, DamageSource source, boolean isVanillaInvulnerable)
-
-
方法详细资料
-
setInvulnerable
public void setInvulnerable(boolean isInvulnerable) Sets the invulnerable status of the entity. By default, the invulnerability will be set by value passed into the event invocation. -
isInvulnerable
public boolean isInvulnerable()- 返回:
- the current invulnerability state
-
getSource
- 返回:
- an immutable reference to the damage source being applied to this entity
-
getOriginalInvulnerability
public boolean getOriginalInvulnerability()- 返回:
- the invulnerability status passed into the event by vanilla
-