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
EntityEvent.CanUpdate, EntityEvent.EnteringChunk, EntityEvent.EntityConstructing
Event.HasResult, Event.Result
Modifier and Type | Field and Description |
---|---|
protected Entity |
attacker |
protected Entity |
originalAttacker |
protected double |
originalRatioX |
protected double |
originalRatioZ |
protected float |
originalStrength |
protected double |
ratioX |
protected double |
ratioZ |
protected float |
strength |
Constructor and Description |
---|
LivingKnockBackEvent(EntityLivingBase target,
Entity attacker,
float strength,
double ratioX,
double ratioZ) |
Modifier and Type | Method and Description |
---|---|
Entity |
getAttacker() |
Entity |
getOriginalAttacker() |
double |
getOriginalRatioX() |
double |
getOriginalRatioZ() |
float |
getOriginalStrength() |
double |
getRatioX() |
double |
getRatioZ() |
float |
getStrength() |
void |
setAttacker(Entity attacker) |
void |
setRatioX(double ratioX) |
void |
setRatioZ(double ratioZ) |
void |
setStrength(float strength) |
getEntityLiving
getEntity
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
protected Entity attacker
protected float strength
protected double ratioX
protected double ratioZ
protected final Entity originalAttacker
protected final float originalStrength
protected final double originalRatioX
protected final double originalRatioZ
public LivingKnockBackEvent(EntityLivingBase target, Entity attacker, float strength, double ratioX, double ratioZ)
public Entity getAttacker()
public float getStrength()
public double getRatioX()
public double getRatioZ()
public Entity getOriginalAttacker()
public float getOriginalStrength()
public double getOriginalRatioX()
public double getOriginalRatioZ()
public void setAttacker(Entity attacker)
public void setStrength(float strength)
public void setRatioX(double ratioX)
public void setRatioZ(double ratioZ)