Not entirely sure what is causing it, or if it consistently occurs (my testing was inconclusive), but on a default superflat world, I had typed "/gamerule doMobSpawning false" , and the game confirmed that it had been successful. I then typed "/kill @e[type=!Player]" a few times to remove any entities and any potential drops. Later, I was confused to find a bunch of villagers in the world, that had apparently spawned in a village just at the outskirts of my render distance. I made sure the gamerule was set to forbid spawning, killed all non-player entities again, and went about my business. As I was continuing to experiment with teleporting entities, I was shocked to accidentally teleport about 20 villagers to myself, again! I hadn't moved to a different area of the map, so the only village near me was the one from before. I again checked the game rule, killed the villagers, and continued, and when it happened again, I decided it was probably something to report. My villagers just won't quit spawning!
Linked issues
is duplicated by 7
relates to 1
Comments 7
Oh... So it's impossible to stop all npc's from spawning?
"Mob" applies to any living entity; it comes from "mobile object" and not "monster". Server.properties distinguishes Monsters, Animals, and NPCs (villagers), while "Mob" applies to all three categories. Setting doMobSpawning to false has prevented monsters and animals from spawning in versions prior to 14w21b, as it should.
All that being said, doMobSpawning only controls natural spawn events. It doesn't control mobs spawned by players, commands, breeding, or terrain generation. Villagers only spawn (without player interaction) from breeding and terrain generation; the latter must be where your villagers came from (in other words, a new village generated somewhere in the distance - terrain generates quite far from you).
Ah, I see. That's what I thought "Mob" referred to, so I was confused when Mustek seemed to imply that only hostile creatures were affected by the gamerule...
As for the issue, however, I had remained in almost exactly the same place for nearly the entire time while villagers kept spawning. All the chunks in a very wide radius around me had long since been generated. Therefore, there shouldn't have been any new chunks generating at the time. In fact, there shouldn't have even been any changes between which chunks were loaded and which ones weren't. And I certainly wasn't spawning any villagers. This is why I found it unusual, and reported it as a bug in the first place...
I believe this should be reopened. It was originally closed based on Mustek's erroneous definition of "mob". doMobSpawning should affect chunk generation, as that is still spawning being done by the world, not by the player.
@Techy4198
Ok...
Mobs are the non-friendly creatures. Villagers are friendly.