Minecraft wiki entry for Crop_farming, associated text: In all cases, the farm must be entirely within the bounds of a village or must be more than 32 blocks away from the outer boundary of any village. Otherwise the villager attempts to make his way to the nearby village instead of tending the crops.