Class LivingKnockBackEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingKnockBackEvent
LivingKnockBackEvent is fired when a living entity is about to be knocked back.
This event is fired whenever an Entity is knocked back in
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
LivingEntity.hurt(DamageSource, float)
,
LivingEntity#blockUsingShield(LivingEntity)
,
Mob.doHurtTarget(Entity)
and
Player.attack(Entity)
This event is fired via
ForgeHooks.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
Cancelable
.If this event is canceled, the entity is not knocked back.
This event does not have a result.
Event.HasResult
This event is fired on the
MinecraftForge.EVENT_BUS
.-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprotected final double
protected final double
protected final float
protected double
protected double
protected float
-
Constructor Summary
ConstructorDescriptionLivingKnockBackEvent
(LivingEntity target, float strength, double ratioX, double ratioZ) -
Method Summary
Modifier and TypeMethodDescriptiondouble
double
float
double
double
float
void
setRatioX
(double ratioX) void
setRatioZ
(double ratioZ) void
setStrength
(float strength) Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
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
-
-
Constructor Details
-
LivingKnockBackEvent
-
-
Method Details
-
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)
-