Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.31 KB | None | 0 0
  1. package net.minecraftforge.event.entity.living;
  2.  
  3. import net.minecraftforge.fml.common.eventhandler.Cancelable;
  4. import net.minecraft.util.DamageSource;
  5. import net.minecraft.entity.EntityLivingBase;
  6.  
  7. /**
  8.  * LivingAttackEvent is fired when a living Entity is attacked. <br>
  9.  * This event is fired whenever an Entity is attacked in
  10.  * EntityLivingBase#attackEntityFrom(DamageSource, float) and
  11.  * EntityPlayer#attackEntityFrom(DamageSource, float). <br>
  12.  * <br>
  13.  * This event is fired via the {@link ForgeHooks#onLivingAttack(EntityLivingBase, DamageSource, float)}.<br>
  14.  * <br>
  15.  * {@link #source} contains the DamageSource of the attack. <br>
  16.  * {@link #amount} contains the amount of damage dealt to the entity. <br>
  17.  * <br>
  18.  * This event is {@link Cancelable}.<br>
  19.  * If this event is canceled, the Entity does not take attack damage.<br>
  20.  * <br>
  21.  * This event does not have a result. {@link HasResult}<br>
  22.  *<br>
  23.  * This event is fired on the {@link MinecraftForge#EVENT_BUS}.
  24.  **/
  25. @Cancelable
  26. public class LivingAttackEvent extends LivingEvent
  27. {
  28.     public final DamageSource source;
  29.     public final float ammount;
  30.     public LivingAttackEvent(EntityLivingBase entity, DamageSource source, float ammount)
  31.     {
  32.         super(entity);
  33.         this.source = source;
  34.         this.ammount = ammount;
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement