--- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
+++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
@@ -10,7 +10,7 @@
     public static final TargetingConditions DEFAULT = forCombat();
     private static final double MIN_VISIBILITY_DISTANCE_FOR_INVISIBLE_TARGET = 2.0D;
     private final boolean isCombat;
-    private double range = -1.0D;
+    public double range = -1.0D; // Paper - public
     private boolean checkLineOfSight = true;
     private boolean testInvisible = true;
     @Nullable
@@ -76,7 +76,7 @@
 
                 if (this.range > 0.0D) {
                     double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0D;
-                    double e = Math.max(this.range * d, 2.0D);
+                    double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0D); // Paper
                     double f = baseEntity.distanceToSqr(targetEntity.getX(), targetEntity.getY(), targetEntity.getZ());
                     if (f > e * e) {
                         return false;
@@ -94,4 +94,18 @@
             return true;
         }
     }
+
+    // Paper start
+    private boolean useFollowRange = false;
+
+    public TargetingConditions useFollowRange() {
+        this.useFollowRange = true;
+        return this;
+    }
+
+    private double getFollowRange(LivingEntity entityliving) {
+        net.minecraft.world.entity.ai.attributes.AttributeInstance attributeinstance = entityliving.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.FOLLOW_RANGE);
+        return attributeinstance == null ? 16.0D : attributeinstance.getValue();
+    }
+    // Paper end
 }
