类 LivingKnockBackEvent
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.LivingKnockBackEvent
- 所有已实现的接口:
net.neoforged.bus.api.ICancellableEvent
public class LivingKnockBackEvent
extends LivingEvent
implements net.neoforged.bus.api.ICancellableEvent
LivingKnockBackEvent is fired when a living entity is about to be knocked back.
This event is fired whenever an Entity is knocked back in
and
This event is fired via
This event is
If this event is canceled, the entity is not knocked back.
This event does not have a result.
This event is fired on the
This event is fired whenever an Entity is knocked back in
Entity.hurt(DamageSource, float)
,
LivingEntity#blockUsingShield(LivingEntity)
,
引用无效
Mob#doHurtTarget(Entity)
Player.attack(Entity)
This event is fired via
CommonHooks.onLivingKnockBack(LivingEntity, float, double, double)
.strength
contains the strength of the knock back. ratioX
contains the x ratio of the knock back. ratioZ
contains the z ratio of the knock back. This event is
ICancellableEvent
.If this event is canceled, the entity is not knocked back.
This event does not have a result.
引用无效
HasResult
This event is fired on the
NeoForge.EVENT_BUS
.-
嵌套类概要
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
从类继承的嵌套类/接口 net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
字段概要
字段修饰符和类型字段说明protected final double
protected final double
protected final float
protected double
protected double
protected float
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明double
double
float
double
double
float
void
setRatioX
(double ratioX) void
setRatioZ
(double ratioZ) void
setStrength
(float strength) 从类继承的方法 net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
字段详细资料
-
strength
protected float strength -
ratioX
protected double ratioX -
ratioZ
protected double ratioZ -
originalStrength
protected final float originalStrength -
originalRatioX
protected final double originalRatioX -
originalRatioZ
protected final double originalRatioZ
-
-
构造器详细资料
-
LivingKnockBackEvent
-
-
方法详细资料
-
getStrength
public float getStrength() -
getRatioX
public double getRatioX() -
getRatioZ
public double getRatioZ() -
getOriginalStrength
public float getOriginalStrength() -
getOriginalRatioX
public double getOriginalRatioX() -
getOriginalRatioZ
public double getOriginalRatioZ() -
setStrength
public void setStrength(float strength) -
setRatioX
public void setRatioX(double ratioX) -
setRatioZ
public void setRatioZ(double ratioZ)
-