public class LivingAttackEvent extends LivingEvent
EntityLivingBase.attackEntityFrom(DamageSource, float)
and
EntityPlayer.attackEntityFrom(DamageSource, float)
. ForgeHooks.onLivingAttack(EntityLivingBase, DamageSource, float)
.source
contains the DamageSource of the attack. amount
contains the amount of damage dealt to the entity. 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 |
---|---|
private float |
amount |
private DamageSource |
source |
Constructor and Description |
---|
LivingAttackEvent(EntityLivingBase entity,
DamageSource source,
float amount) |
Modifier and Type | Method and Description |
---|---|
float |
getAmount() |
DamageSource |
getSource() |
getEntityLiving
getEntity
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
private final DamageSource source
private final float amount
public LivingAttackEvent(EntityLivingBase entity, DamageSource source, float amount)
public DamageSource getSource()
public float getAmount()