Class StopAttackingIfTargetInvalid<E extends Mob>

java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<E>
net.minecraft.world.entity.ai.behavior.StopAttackingIfTargetInvalid<E>

public class StopAttackingIfTargetInvalid<E extends Mob> extends Behavior<E>
  • Field Details

    • TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE

      private static final int TIMEOUT_TO_GET_WITHIN_ATTACK_RANGE
      See Also:
      Constant Field Values
    • stopAttackingWhen

      private final Predicate<LivingEntity> stopAttackingWhen
    • onTargetErased

      private final Consumer<E extends Mob> onTargetErased
  • Constructor Details

    • StopAttackingIfTargetInvalid

      public StopAttackingIfTargetInvalid(Predicate<LivingEntity> p_147983_, Consumer<E> p_147984_)
    • StopAttackingIfTargetInvalid

      public StopAttackingIfTargetInvalid(Predicate<LivingEntity> p_24236_)
    • StopAttackingIfTargetInvalid

      public StopAttackingIfTargetInvalid(Consumer<E> p_147981_)
    • StopAttackingIfTargetInvalid

      public StopAttackingIfTargetInvalid()
  • Method Details

    • start

      protected void start(ServerLevel p_24242_, E p_24243_, long p_24244_)
      Overrides:
      start in class Behavior<E extends Mob>
    • isCurrentTargetInDifferentLevel

      private boolean isCurrentTargetInDifferentLevel(E p_24248_)
    • getAttackTarget

      private LivingEntity getAttackTarget(E p_24252_)
    • isTiredOfTryingToReachTarget

      private static <E extends LivingEntity> boolean isTiredOfTryingToReachTarget(E p_24246_)
    • isCurrentTargetDeadOrRemoved

      private boolean isCurrentTargetDeadOrRemoved(E p_24254_)
    • clearAttackTarget

      protected void clearAttackTarget(E p_24256_)