public class LivingKnockBackEvent extends LivingEvent
EntityLivingBase#attackEntityFrom(DamageSource, float)
,
EntityLivingBase#blockWithShield(EntityLivingBase)
,
EntityMob#attackEntityAsMob(Entity)
and
EntityPlayer#attackTargetEntityWithCurrentItem(Entity)
ForgeHooks#onLivingKnockBack(EntityLivingBase, Entity, float, double, double)
.#attacker
contains the Entity that caused the knock back. 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. Cancelable
.HasResult
MinecraftForge.EVENT_BUS
.LivingEvent.LivingJumpEvent, LivingEvent.LivingUpdateEvent, LivingEvent.LivingVisibilityEvent
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing, EntityEvent.Size
Modifier and Type | Field and Description |
---|---|
protected double |
originalRatioX |
protected double |
originalRatioZ |
protected float |
originalStrength |
protected double |
ratioX |
protected double |
ratioZ |
protected float |
strength |
Constructor and Description |
---|
LivingKnockBackEvent(LivingEntity target,
float strength,
double ratioX,
double ratioZ) |
Modifier and Type | Method and Description |
---|---|
double |
getOriginalRatioX() |
double |
getOriginalRatioZ() |
float |
getOriginalStrength() |
double |
getRatioX() |
double |
getRatioZ() |
float |
getStrength() |
void |
setRatioX(double ratioX) |
void |
setRatioZ(double ratioZ) |
void |
setStrength(float strength) |
getEntityLiving
getEntity
protected float strength
protected double ratioX
protected double ratioZ
protected final float originalStrength
protected final double originalRatioX
protected final double originalRatioZ
public LivingKnockBackEvent(LivingEntity target, float strength, double ratioX, double ratioZ)
public float getStrength()
public double getRatioX()
public double getRatioZ()
public float getOriginalStrength()
public double getOriginalRatioX()
public double getOriginalRatioZ()
public void setStrength(float strength)
public void setRatioX(double ratioX)
public void setRatioZ(double ratioZ)