29

I understand monsters only spawn in a 9 x 9 grid of chunks centered on the player, and I assume they stay around while they remain within that distance of you. But do they despawn as soon as you move away from them? Or do they remain? If so what (if anything) causes them to despawn? Are the rules any different for passive mobs?

Will running far away from an area and then coming right back clear it of monsters?

5
  • Interesting! If they don't despawn this is useful for mob spawners, although I use creative mode these days... Oct 2, 2011 at 1:27
  • I believe you are referring to passive mobs. They respawn very slowly, but there are many more.
    – Domocus
    Oct 2, 2011 at 1:39
  • Farm animals actually respawn in 1.8? I thought I drove them to extinction - at least, I have yet to see any new ones...
    – Cyclops
    Oct 2, 2011 at 20:19
  • I see no discussion of vertical. Is vertical distance irrelevant for spawning?
    – John
    Jan 13, 2012 at 15:12
  • @Matt You may wish to reconsider which answer you have accepted, due to changes in updates. Mar 19, 2016 at 0:56

5 Answers 5

16

My answer is no longer correct, even though, at the time of posting, it was. Look to some of the other answers (particularly the bounty winner) for more up to date information.


Most important rule: when a chunk is unloaded, so are the mobs (and all other items) on it, although passive mobs won't be removed.

There is also a limit on the number of mobs that can be loaded at one time: 200 hostile and 15 neutral mobs (I don't know if there's a limit on passive mobs). Also, hostile mobs are removed if they leave the 9x9 chunks that they're allowed to spawn in.

Running away will usually allow you to stay out of the reach of hostile mobs, since a chunk needs to be loaded a certain amount of time before mobs will start to spawn, but the chunks immediately behind you could have the max allowable mobs, making it dangerous at best to turn around.

Take a look at the wiki for more information.

7
  • "so are the mobs" except for squid.
    – user1381
    May 2, 2011 at 22:03
  • Yes, squid do have special rules, but they still despawn when the chunk they're in is unloaded.
    – MBraedley
    May 3, 2011 at 2:01
  • As of 1.8 passive mobs no longer despawn. Sep 22, 2011 at 20:42
  • @John: Even when a chunk is unloaded?
    – MBraedley
    Sep 23, 2011 at 10:38
  • Correct. Notch decided to try to make passive mobs more permanent so he removed the code that despawned them. Sep 23, 2011 at 15:35
19

From the EntityAnimal class in EntityAnimal.java:

protected boolean canDespawn()
{
    return false;
}

This should apply to all passive mobs. (I checked, they all extend the EntityAnimal class.)

Wolves however are interesting:

protected boolean canDespawn()
{
    return !isWolfTamed();
}

So this means that tamed wolves do not despawn, while wild wolves do despawn.

It seems that slimes and squid will also despawn. Both classes contain this method:

protected void updateEntityActionState()
<snipped>
    despawnEntity();
<snipped>

I didn't see any other references to despawning.

3
18
+50

As of Minecraft 1.8, these are the two main despawning rules:

  • If a mob has not been within 32 blocks1 of a player for more than 30 seconds, it has a 1 in 800 chance every tick of despawning (about 1 in 40 every second)
  • If there are no players within a 128 block radius2 of a mob, it will instantly despawn

Exceptions:

  • Mobs with nametags will never despawn, except...
  • Mobs which have picked up items (i.e. were not spawned with that item) will never despawn, except...
  • When the gamemode is set to peaceful, all hostile mobs will despawn (including those with nametags, or those who have picked up items)
  • Passive mobs will never despawn (except chickens originally spawned as chicken jockeys, which will follow zombie despawning rules)

For those who like diagrams, this image will help: (From the Minecraft Wiki)

Diagram of which the information is outlined in dotpoints

Footnotes:

1 Not sure whether this is a sphere or a cylinder It is confirmed to be an Euclidean sphere (like the the instant despawn zone). Testing apparatus:

The zombie despawned after about 2 mins when I stood more than 32 blocks below it

2 An Euclidean sphere with a radius of 128 blocks

More Notes:

  • If there are more mobs than allowed by their mob cap, no special despawning rules are followed. Mob spawning is simply suspended until they despawn naturally. Source (looking for a better citation)
2
  • Small nitpick, the chances of a mob despawning in a given second are slightly worse than 1 in 40, because statistics are messed up that way.
    – MBraedley
    Feb 5, 2016 at 11:33
  • Years later I'd like to add that pigs do get replaced with a zombie pigman when struck by a lightening wich affects the passive mob counter and could be interpreted as despawning.
    – Froxx
    Apr 28, 2020 at 15:40
3

EDIT: The forum post is apparently gone in one of curse's migrations of the minecraft forums. Until I can find a good suitable replacement the Wiki page is the best I can come up with which can be found here.

Information most notably claims there is a 60 block radius around the player that hostile mobs can spawn in, but there is a 24 block buffer zone centered around the player that hostile mobs will not spawn within..

A quick answer to some of your questions from my own observations:

  1. Yes, they will despawn if you move far enough away.

  2. I am not sure of the exact rules, but I would bet the 60 block range is one of them. I have had things fairly close to me (Within the 24 block range) just despawn at times for apparently no reason (most notably with creepers believe it or not).

  3. They are a bit different in the areas they can spawn within to begin with (grass and well lit) as well as the range and count of them. It also appears that they follow the same general guidelines for despawning, based on their spawn rules.. The forum post mentioned above can get you the details there (their distances and the like).

  4. Yes, if you run far enough, what was there will despawn. However, it is just as likely that the area will respawn, if it is night, as you are running towards it because of the 'donut' spawn area I mentioned above (closer than 60 blocks, farther than 24 blocks).

Anywho, enjoy the link, helped me out quite a bit!

3
  • It's a 144 x 144 block area centered on the player. That's more like a 144 block diameter, not a 144 block radius.
    – Matt
    May 3, 2011 at 11:47
  • @Matt you are correct! I went back and re-read Item 3, and while the wont spawn radius is 24m, the will spawn radius appears to be 60m around you (excluding that 24m radius). Answer Updated :)
    – James
    May 3, 2011 at 16:05
  • @James the forum link appears to be dead?
    – John
    Jan 13, 2012 at 15:11
0

As far as I know, hostile and neutral mobs start despawning automatically when you are at some tens of meters (blocks) away from them, let's say around 30, and the chances (probably) get better as you get farther.
Also, make sure not to be decieved when they get out of your sight, (at about 60 blocks away) and think that they despawned. Even if they have significant chances of doing so, sometimes they won't. So going back where an angry skeleton or a creeper was, with the hopes that it's gone, you might get surprised.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .