mojira.dev
MCPE-27828

Disable mobs/animals just kills the animals/mobs when they spawn in

Animals kept spawning and dying when i where in a flat world. All mobs and animals where turned of so they shouldnt spawn.

Comments 1

Sometimes the game spawns mobs a little ways outside the area a player is in, beyond the chunks that are "loaded" (being actively updated). (Technically, although the game randomly picks a spawn point from within the active chunks, it then picks a second random point near it for the position of each actual mob. This is because sometimes a whole pack of mobs get spawned at the same time, and each one needs to be at a different position. If the first spawn point is near the edge of the active chunks around the player, the second randomization can move it beyond the edge into an inactive chunk.)
This happens mostly in chunks that are 4-6 chunks (about 64-111 blocks) away from the player. When it happens, the spawning is left in a suspended state because the inactive chunks aren't able to finish creating it. Turning off mob spawning doesn't destroy these mobs, since they haven't been fully spawned yet. So if you turn off mob spawning after loading the game, these previously-spawned suspended mobs aren't affected. Later, when you get nearer to them, the chunk becomes active and finishes spawning them, but since mob spawning is turned off they die immediately.

You can test whether this is causing your problem as follows:

  1. Open a world with non-Peaceful difficulty and mob spawning turned on.

  2. Walk around a few dozen blocks to give the game plenty of chances to spawn these suspended mobs.

  3. Return to your original position.

  4. Turn off mob spawning and wait for any nearby mobs to die.

  5. Walk roughly the same path again. You should see some suspended mobs appear and immediately die 64-111 blocks away from you.

  6. Walk the path a third time. If you don't see any more mobs, the above explanation describes what is happening, because no new mobs should have been spawned with mob spawning turned off.

If this is the problem, there are a couple of easy workarounds. You can either turn off mob spawning before you open the world, or you can save and exit and then reload the world after turning off mob spawning. This works because suspended mobs aren't saved with the game, since they don't really exist yet. Hopefully Mojang will sooner or later come up with a solution so workarounds like this won't be needed.

If this isn't the problem, try to narrow down the problem with more details about things that affect mob spawning. Does it happen even before you walk around after turning off mob spawning? Does it happen even if mob spawning was already turned off when you opened the world? How close to you (roughly) are these mobs? Is it all mobs, just passive mobs, or just hostile mobs? Could a nearby mob spawner be causing the problem, perhaps in a cave just below the surface? What are the lighting conditions like near these mobs? Any of these questions you answer can provide important clues to the developer about what's happening.

Caroline

(Unassigned)

Unconfirmed

Xbox

1.2.2.3

Retrieved