Class EntityAttackEvent

java.lang.Object
net.minestom.server.event.entity.EntityAttackEvent
All Implemented Interfaces:
Event, EntityEvent, EntityInstanceEvent, InstanceEvent

public class EntityAttackEvent extends Object implements EntityInstanceEvent
Called when a player does a left click on an entity or with EntityCreature.attack(Entity).
  • Constructor Details

    • EntityAttackEvent

      public EntityAttackEvent(@NotNull @NotNull Entity source, @NotNull @NotNull Entity target)
  • Method Details

    • getEntity

      @NotNull public @NotNull Entity getEntity()
      Description copied from interface: EntityEvent
      Gets the entity of this event.
      Specified by:
      getEntity in interface EntityEvent
      Returns:
      the entity
    • getTarget

      @NotNull public @NotNull Entity getTarget()
      Returns:
      the target of the attack