--- a/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
+++ b/net/minecraft/world/entity/ai/behavior/AcquirePoi.java
@@ -47,6 +47,7 @@
                         return false;
                     } else {
                         mutableLong.setValue(time + 20L + (long)world.getRandom().nextInt(20));
+                        if (entity.getNavigation().isStuck()) mutableLong.add(200); // Paper - Wait an additional 10s to check again if they're stuck
                         PoiManager poiManager = world.getPoiManager();
                         long2ObjectMap.long2ObjectEntrySet().removeIf((entry) -> {
                             return !entry.getValue().isStillValid(time);
@@ -62,7 +63,11 @@
                                 return true;
                             }
                         };
-                        Set<Pair<Holder<PoiType>, BlockPos>> set = poiManager.findAllClosestFirstWithType(poiPredicate, predicate2, entity.blockPosition(), 48, PoiManager.Occupancy.HAS_SPACE).limit(5L).collect(Collectors.toSet());
+                        // Paper start - optimise POI access
+                        java.util.List<Pair<Holder<PoiType>, BlockPos>> poiposes = new java.util.ArrayList<>();
+                        io.papermc.paper.util.PoiAccess.findNearestPoiPositions(poiManager, poiPredicate, predicate2, entity.blockPosition(), 48, 48*48, PoiManager.Occupancy.HAS_SPACE, false, 5, poiposes);
+                        Set<Pair<Holder<PoiType>, BlockPos>> set = new java.util.HashSet<>(poiposes);
+                        // Paper end - optimise POI access
                         Path path = findPathToPois(entity, set);
                         if (path != null && path.canReach()) {
                             BlockPos blockPos = path.getTarget();
