So i made a village close to my house but I put fence all around it. 2 did escape, I don’t know how since I checked all the fence. But then when I logged in there was one in my house and I just assumed it was one of the escapees, but when I looked in my chest and turned around again there suddenly were 4... and I went to look and the 2 escapees from before were still in the back behind the village. Can they spawn naturally around a village?
Villagers never naturally/randomly spawn; they can only spawn during world generation in village houses and igloo basements, breeding, or a player curing zombie villagers. So you must of have more escape than you realized, or your house has multiple beds (they will breed up to one villager per bed; in this case the sudden appearance of more villagers should have included children):
When I protect a village I build a wall around it, at least 3 blocks high with ladders placed at intervals (one ladder on the middle block) so I can get in and out, with the only mobs able to get in being spiders (I fixed the aforementioned bug but I still don't 100% trust partial blocks like fences, or surrounding a villager with non-transparent blocks to keep them in place).
I also was in my house just with the back to. And i did not hear anyone enter the house, so they did not come from outside since no doors opened. So they had to spawn. But why 4 when there's only 1 bed
So i made a village close to my house but I put fence all around it. 2 did escape, I don’t know how since I checked all the fence. But then when I logged in there was one in my house and I just assumed it was one of the escapees, but when I looked in my chest and turned around again there suddenly were 4... and I went to look and the 2 escapees from before were still in the back behind the village. Can they spawn naturally around a village?
Yes. The villager AI can "detect" houses and can even spawn in them.
Villagers never naturally/randomly spawn; they can only spawn during world generation in village houses and igloo basements, breeding, or a player curing zombie villagers. So you must of have more escape than you realized, or your house has multiple beds (they will breed up to one villager per bed; in this case the sudden appearance of more villagers should have included children):
https://minecraft.gamepedia.com/Villager#Spawning
Also, mobs can escape through fences, even without reloading a world (I've seen this happen before, most likely with smaller mobs like baby chickens):
MC-2025 Mobs going out of fenced areas/suffocate in blocks when loading chunks
When I protect a village I build a wall around it, at least 3 blocks high with ladders placed at intervals (one ladder on the middle block) so I can get in and out, with the only mobs able to get in being spiders (I fixed the aforementioned bug but I still don't 100% trust partial blocks like fences, or surrounding a villager with non-transparent blocks to keep them in place).
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
Is there a way to stop them from spawning in my house then?
I also was in my house just with the back to. And i did not hear anyone enter the house, so they did not come from outside since no doors opened. So they had to spawn. But why 4 when there's only 1 bed