I was building a village (Minecraft pocket edition, creative, peaceful). I spawned 2 villagers, after a while, there were 50 houses and a lot of villagers, but they went further and further away from the village. Is there a way to prevent it (except building a wall)?
The only way to prevent this besides building a wall is by building more houses in the designated village area. Villages paths go out to the age of the area so that gives you a clue. But since you have 50 houses, villagers can no longer stay. this is because the village is, "Over crowded" so there is no other way you can do this.