Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

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?

share|improve this question
    
Interesting! If they don't despawn this is useful for mob spawners, although I use creative mode these days... –  Tom Wijsman Oct 2 '11 at 1:27
    
I believe you are referring to passive mobs. They respawn very slowly, but there are many more. –  Domocus Oct 2 '11 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 '11 at 20:19
    
I see no discussion of vertical. Is vertical distance irrelevant for spawning? –  John Jan 13 '12 at 15:12

3 Answers 3

up vote 12 down vote accepted

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.

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

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.

share|improve this answer
    
Where did you obtain the source code of Minecraft? –  Anderson Green Nov 1 '12 at 1:02
    
@AndersonGreen I use the Minecraft Coder Pack –  John the Green Nov 1 '12 at 16:46

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!

share|improve this answer
    
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 '11 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 '11 at 16:05
    
@James the forum link appears to be dead? –  John Jan 13 '12 at 15:11

protected by fredley Apr 22 '13 at 13:49

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.