Minecraft wiki entry for Door-based_iron_golem_farming, associated text: If your doors are on the pit's edge, then avoid placing the doors during the day! Otherwise villagers might fall into your pit. Place them and block them with glass before daylight. Once you have placed all your doors, destroy any remaining doors in other buildings that aren't part of the symmetry of the farm. Also destroy beds in any building that isn't part of your farm, and put them in your new buildings, preferably in a symmetric arrangement. Your buildings around the pit should have doors (symmetrically placed) on the side walls to allow villagers to use the buildings.