--- a/net/minecraft/world/entity/ai/sensing/NearestItemSensor.java
+++ b/net/minecraft/world/entity/ai/sensing/NearestItemSensor.java
@@ -24,13 +24,17 @@
     @Override
     protected void doTick(ServerLevel world, Mob entity) {
         Brain<?> brain = entity.getBrain();
-        List<ItemEntity> list = world.getEntitiesOfClass(ItemEntity.class, entity.getBoundingBox().inflate(32.0, 16.0, 32.0), itemEntity -> true);
+        List<ItemEntity> list = world.getEntitiesOfClass(ItemEntity.class, entity.getBoundingBox().inflate(32.0, 16.0, 32.0), itemEntity -> itemEntity.closerThan(entity, MAX_DISTANCE_TO_WANTED_ITEM) && entity.wantsToPickUp(itemEntity.getItem())); // Paper - Perf: Move predicate into getEntities
         list.sort(Comparator.comparingDouble(entity::distanceToSqr));
-        Optional<ItemEntity> optional = list.stream()
-            .filter(itemEntity -> entity.wantsToPickUp(itemEntity.getItem()))
-            .filter(itemEntity -> itemEntity.closerThan(entity, 32.0))
-            .filter(entity::hasLineOfSight)
-            .findFirst();
-        brain.setMemory(MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, optional);
+        // Paper start - Perf: remove streams from hot code
+        ItemEntity nearest = null;
+        for (ItemEntity entityItem : list) {
+            if (entity.hasLineOfSight(entityItem)) { // Paper - Perf: Move predicate into getEntities
+                nearest = entityItem;
+                break;
+            }
+        }
+        brain.setMemory(MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, Optional.ofNullable(nearest));
+        // Paper end - Perf: remove streams from hot code
     }
 }
