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:
    • stopAttackingWhen

      private final Predicate<LivingEntity> stopAttackingWhen
    • onTargetErased

      private final BiConsumer<E extends Mob,LivingEntity> onTargetErased
    • canGrowTiredOfTryingToReachTarget

      private final boolean canGrowTiredOfTryingToReachTarget
  • Constructor Details

  • 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_)