--- a/net/minecraft/world/entity/ai/behavior/SleepInBed.java
+++ b/net/minecraft/world/entity/ai/behavior/SleepInBed.java
@@ -42,7 +_,8 @@
                     }
                 }
 
-                BlockState blockState = level.getBlockState(globalPos.pos());
+                BlockState blockState = level.getBlockStateIfLoaded(globalPos.pos()); // Paper - Prevent sync chunk loads when villagers try to find beds
+                if (blockState == null) { return false; } // Paper - Prevent sync chunk loads when villagers try to find beds
                 return globalPos.pos().closerToCenterThan(owner.position(), 2.0) && blockState.is(BlockTags.BEDS) && !blockState.getValue(BedBlock.OCCUPIED);
             }
         }
