Class AttackEntityEvent


  • public class AttackEntityEvent
    extends PlayerEvent
    AttackEntityEvent is fired when a player attacks an Entity.
    This event is fired whenever a player attacks an Entity in EntityPlayer#attackTargetEntityWithCurrentItem(Entity).

    target contains the Entity that was damaged by the player.

    This event is Cancelable.
    If this event is canceled, the player does not attack the Entity.

    This event does not have a result. Event.HasResult

    This event is fired on the MinecraftForge.EVENT_BUS.
    • Field Detail

      • target

        private final Entity target
    • Constructor Detail

    • Method Detail

      • getTarget

        public Entity getTarget()