--- a/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
+++ b/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
@@ -77,7 +77,7 @@
 
                 if (this.range > 0.0) {
                     double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0;
-                    double e = Math.max(this.range * d, 2.0);
+                    double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0); // Paper - Fix MC-145656
                     double f = baseEntity.distanceToSqr(targetEntity.getX(), targetEntity.getY(), targetEntity.getZ());
                     if (f > e * e) {
                         return false;
@@ -92,4 +92,18 @@
             return true;
         }
     }
+
+    // Paper start - Fix MC-145656
+    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 - Fix MC-145656
 }
