Class FollowTargetGoal<T extends LivingEntity>

Direct Known Subclasses:
BeeEntity.BeeFollowTargetGoal, DisableableFollowTargetGoal, EndermanEntity.TeleportTowardsPlayerGoal, FollowTargetIfTamedGoal, FoxEntity.DefendFriendGoal, LlamaEntity.ChaseWolvesGoal, PolarBearEntity.FollowPlayersGoal, RaidGoal, ShulkerEntity.SearchForPlayerGoal, ShulkerEntity.SearchForTargetGoal, SpiderEntity.FollowTargetGoal, VindicatorEntity.FollowEntityGoal

public class FollowTargetGoal<T extends LivingEntity>
extends TrackTargetGoal
  • Field Details

    • targetClass

      protected final Class<T extends LivingEntity> targetClass
    • reciprocalChance

      protected final int reciprocalChance
    • targetEntity

      protected LivingEntity targetEntity
    • targetPredicate

      protected TargetPredicate targetPredicate
  • Constructor Details

    • FollowTargetGoal

      public FollowTargetGoal​(MobEntity mob, Class<T> targetClass, boolean checkVisibility)
    • FollowTargetGoal

      public FollowTargetGoal​(MobEntity mob, Class<T> targetClass, boolean checkVisibility, boolean checkCanNavigate)
    • FollowTargetGoal

      public FollowTargetGoal​(MobEntity mob, Class<T> targetClass, int reciprocalChance, boolean checkVisibility, boolean checkCanNavigate, @Nullable Predicate<LivingEntity> targetPredicate)
  • Method Details

    • canStart

      public boolean canStart()
      Specified by:
      canStart in class Goal
    • getSearchBox

      protected Box getSearchBox​(double distance)
    • findClosestTarget

      protected void findClosestTarget()
    • start

      public void start()
      Overrides:
      start in class TrackTargetGoal
    • setTargetEntity

      public void setTargetEntity​(@Nullable LivingEntity targetEntity)