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
-
public class LivingKnockBackEvent extends LivingEvent
LivingKnockBackEvent is fired when a living entity is about to be knocked back.
This event is fired whenever an Entity is knocked back inEntityLivingBase#attackEntityFrom(DamageSource, float),EntityLivingBase#blockWithShield(EntityLivingBase),EntityMob#attackEntityAsMob(Entity)andEntityPlayer#attackTargetEntityWithCurrentItem(Entity)
This event is fired viaForgeHooks#onLivingKnockBack(EntityLivingBase, Entity, float, double, double).
#attackercontains the Entity that caused the knock back.
strengthcontains the strength of the knock back.
ratioXcontains the x ratio of the knock back.
ratioZcontains the z ratio of the knock back.
This event isCancelable.
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 theMinecraftForge.EVENT_BUS.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
-
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
-
-
Field Summary
Fields Modifier and Type Field Description protected doubleoriginalRatioXprotected doubleoriginalRatioZprotected floatoriginalStrengthprotected doubleratioXprotected doubleratioZprotected floatstrength
-
Constructor Summary
Constructors Constructor Description LivingKnockBackEvent(LivingEntity target, float strength, double ratioX, double ratioZ)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetOriginalRatioX()doublegetOriginalRatioZ()floatgetOriginalStrength()doublegetRatioX()doublegetRatioZ()floatgetStrength()voidsetRatioX(double ratioX)voidsetRatioZ(double ratioZ)voidsetStrength(float strength)-
Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntityLiving
-
Methods inherited from class net.minecraftforge.event.entity.EntityEvent
getEntity
-
-
-
-
Constructor Detail
-
LivingKnockBackEvent
public LivingKnockBackEvent(LivingEntity target, float strength, double ratioX, double ratioZ)
-
-
Method Detail
-
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)
-
-