Class EntityKnockbackByEntityEvent

All Implemented Interfaces:
Cancellable

public class EntityKnockbackByEntityEvent extends EntityPushedByEntityAttackEvent
Fired when an Entity is knocked back by the hit of another Entity. The acceleration vector can be modified. If this event is cancelled, the entity is not knocked back.
  • Constructor Details

  • Method Details

    • getEntity

      @NotNull public LivingEntity getEntity()
      Description copied from class: EntityEvent
      Returns the Entity involved in this event
      Overrides:
      getEntity in class EntityEvent
      Returns:
      the entity which was knocked back
    • getKnockbackStrength

      public float getKnockbackStrength()
      Returns:
      the original knockback strength.
    • getHitBy

      @NotNull public Entity getHitBy()
      Returns:
      the Entity which hit