Class EntityTargetLivingEntityEvent

All Implemented Interfaces:

public class EntityTargetLivingEntityEvent extends EntityTargetEvent
Called when an Entity targets a LivingEntity and can only target LivingEntity's.
  • Constructor Details

  • Method Details

    • getTarget

      @Nullable public LivingEntity getTarget()
      Description copied from class: EntityTargetEvent
      Get the entity that this is targeting.

      This will be null in the case that the event is called when the mob forgets its target.

      getTarget in class EntityTargetEvent
      The entity
    • setTarget

      public void setTarget(@Nullable Entity target)
      Set the Entity that you want the mob to target.

      It is possible to be null, null will cause the entity to be target-less.

      Must be a LivingEntity, or null.

      setTarget in class EntityTargetEvent
      target - The entity to target