Sorry for the confusion causing. This post details the way mob spawning worked prior to the Halloween update. In the current version, the 0,0 exploit no longer works, and the bail-out clause has been removed entirely. The spawnable region is now 17x17 chunks, mobs spawn in packs of up to 12, and to the best of my knowledge, slimes don't spawn naturally anymore. Other than that, it hasn't changed too much.
I'll probably write it up properly one of these days, but for now this will have to suffice.
I've heard a lot of myths and rumors regarding the way mobs spawn and the best ways to capitalize on this. So I've started doing some research. Some of the information was collected via experimentation on codewarrior's CleanRoom map, a massive empty world which consists of one layer of adminium and one layer of wool above it.
The rest was gathered by decompiling the spawning code. There are still a few gaps in our understanding of it, but nothing critical. Special thanks to wabbiteh for helping me work out the algorithm.
Section 1: The Almighty Rules of Mob Spawning™:
1) Difficulty does not affect spawn frequency.
For reals. This has been verified in code. The spawning algorithm makes no check of the difficulty parameter in spawning mobs. Even Peaceful technically has the same spawning rate, though the hostile mobs are removed immediately afterward.
2) Mobs can spawn on man-made materials.
Cobblestone, double steps :stair:, and wool work precisely as well as stone and dirt. They will not spawn on glass or half steps :_:, though. There is no difference in frequency of spawns either.
3)Spawn activity only exists in a 144x144 area around you and not within 24m of you.
Specifically, it happens in the local 81 chunks around the player. The minimum distance mobs can spawn from the player can be described as a spherical bubble with a 24m radius.
Looks like this:
Mobs also can't spawn within 24m of the player spawning point.
4) Large slimes can exist on peaceful.
While they won't spawn on peaceful, they will spawn on any other difficulty. Unlike other hostile mobs, however, slimes won't disappear when switched to peaceful mode, even large ones. If you kill a large slime on peaceful, it won't turn into mini-slimes. Slimes can also spawn at any light level, but only in the bottom 15 layers.
5) Hostile mobs spawn at light level 7 or lower. Friendly mobs spawn at 9 and above, and only on grass.
The light level of a tile is calculated in an odd way. It's base light level is compared against the 4 tiles neighboring it and the air block above it. The brightest of these blocks is considered the main tile's light level. This means that even if a tile is level 7, if any of the neighboring blocks are 8, a hostile mob cannot spawn.
*edit* This expanded sensitivity is only for dirt and half-steps. I have no idea why.
6) The probability of a hostile mob spawning on a specific tile is affected by the light level of that tile (and by properties of the surrounding region).
A random number R between 0 to 7 is rolled. If the light level is ≤ R, a mob can spawn on that tile on that turn, so a pitch dark cave at level 0 will spawn mobs at 175% the rate of moonlit areas at level 4. For reference, torches produce level 14 light, fire and sunlight produce 15, moonlight produces 4, and redstone torches produce level 7. Every block removed from a light source, the level drops by 1.
To understand the regional affects, see section 3.
7)There is a cap of 200 hostile mobs and 15 friendly mobs at any given time.
Once the cap is reached, no new mobs can be spawned until some either die, despawn, or unloaded with a chunk.
8)Placing torches in one room won't affect the probability of mobs spawning in another room.
The exception, of course, is when the population cap has been reached. A mob gets one shot to get placed in a chunk per turn. If a torch prevents it from spawning, it doesn't get to repick its location, so no other location is affected by that torch. In other words, you can't use torches to funnel mobs into a single area.
9)Slime spawns are broken.
All sorts of broken. The algorithm takes the X,Y coordinates instead of the X,Z coordinates to locate the current chunk, on top of a seriously confusing random seeding operation. But fear not. This thread has a patch if you are interested. (Slimes will still be elusive creatures after the patch, just better distributed chunk-wise).
Section 2: The Spawning Algorithm:
The spawning algorithm is called typically 20 times per second. It is executed twice per turn; once for hostile mobs and once for friendly mobs.
Main Spawn Loop:
1) Load all of the 81 local chunks into a semi-random list. (It is not truely random, but a specific order cannot be guaranteed)
2) If the list is not empty, take one chunk from the list.
3) Roll a random number. 1:10 chance proceed to 4), otherwise skip chunk and go back to 2).
4) Chose a mob class at random (for friendlies: pig,cow,chicken,sheep. For hostiles: spider,skeleton,zombie,creeper,slime).
5) Chose a completely random location L1 within the chunk.
6) If L1 is inside a rock or other solid area, bail out of the spawn function completely. Ignore the remaining chunks.
7) If L1 is legal it will be the location of a mob pack, pick 6 locations roughly normally distributed around L1, L(i)
Individual Spawn Loop:
8) Check that current L(i) is unoccupied, has spawnable ground below, and an empty space above.
9) If check fails, get next L(i) and go back to 8).
10) Check that L(i) is 24m+ from (any) player. Also check they are 24m+ from the spawn point. If not, get next L(i) and go back to 8).
11) Prepare mob for spawning (position, orientation, etc).
12) LGT(i) = light level of L(i)
13) (hostile mobs) Roll random R from 0 to 7. If LGT(i) ≤ R, spawn mob at L(i).
13) (friendly mob) If LGT(i) > 8, spawn mob at L(i).
14) If mob class was Spider, roll a random number. 1:100 chance also spawn a skeleton and have it mount the spider.
15) Get next L(i) and go back to 8).
16) When done with all L(i), go back to 2).
17)return
(note: slimes have special rules regarding elevation and light levels, as mentioned in section 1)
Section 3: Discussion:
Assuming you are trying to maximize the number of mob spawns for a harvester or something, there are a few things that should be addressed. The ideal spawning area is like that of CleanRoom: entirely empty space except for a single floor to spawn on. In CleanRoom, mobs spawn so fast that at night it can reach the 200 mob cap within seconds.
The reason for this is that the bailout clause at step 6 is almost entirely avoided as only a mere 0.8% of the locations in the chunks are occupied by solid blocks. Therefore, most of the time all 81 chunks get their chance to spawn a mob pack.
You might think that having multiple floors to spawn on would increase the spawn rate even more, having a larger surface area to work on. While strictly speaking this is true, it also increases the chance of triggering the bailout clause which in the long run is far more harmful.
Assuming most people don't have the resources to dig out a 144x144 pit, the best thing you can do for your spawn rate is to find areas with low elevation and as many caves as possible. The more open air there is, the better the spawn rate will be. Even without mapping out the cave systems you can locate good places. Explore around until you encounter an area with disproportionate amount of mobs. Chances are that area will continue to support a high population of mobs.
Section 4: The Black Magic Spawning Tower:
The chunk traversal order is unique for every chunk the player is in, but there is one exception. If the chunk (0,0) (blocks 0,0 to 15,15) is one of the 81 chunks visited, it will always be the first evaluated. This can be exploited. Regardless of the terrain, there is a 100% chance the algorithm will not bail out before getting to this chunk. This means that chunk (0,0) has the highest chance of spawning mobs than any of the other 8 chunks. It's as high as CleanRoom.
To illustrate this, I built a 19x19x64 tower over chunk (0,0) with 16 spawning floors. After a couple of minutes there were about 150 mobs in the tower, and there probably would have been more if the cap hadn't been reached.
(glass was hacked in with NBTForge for your viewing convenience. Original walls were rock.)
This technique should work on any map, and if I'm not mistaken, SMP, too (as of yet unverified).
To learn how to utilize this trick like a pro, check out Bucyruss's thread on the subject.
I may add a few more things in the future, but this is more or less the final version.
Hope it helps, and happy harvesting.
I find the half-step spawning interesting, this would mean that if I covered my base with halfsteps I could never need to use torches! This could come in handy on coal-lacking new maps.
i like, should test which mobs spawn at ertain light strength's
*edit*
Mobs can spawn in level 8 light or lower. It's possible they can spawn in level 7, but I have yet to see that. For reference, 0 is absolute darkness, moonlight is 4, redstone torches produce 7, regular torches produce 14, and sunlight is 15. Light sources drop 1 level every block removed.
Things to check:
* Spawn rate (how many per minute/night)
* Is spawn rate effected by the number of dark squares in the spawn radius (ie. multiple layers vs. one layer of black)
2) Difficulty does not affect spawn frequency.
In the CleanRoom map, I would get around 200 mobs present one every difficulty level except for peaceful.
That's actually a pretty significant find for me, I've always been sure there were more on easy but I guess this shuts me up on that.
Ran a few more experiments. Mobs can unload with the chunks, so I'm not sure what causes them to disappear normally.
Regardless of the time of day, mobs will continue to spawn (fairly quickly) in acceptable locations until the area reaches its saturation limit, after which no new mobs will spawn. I'm still trying to figure out the rules determining the saturation limit.
Spawns are randomly distributed amongst all acceptable areas. If there is only one available area, they will spawn quite densely.
Friendly mobs spawn twice a day, once at dusk and once at dawn. Hostile mobs have no such limitation.
To optimize mob harvesting try these things:
1) Light up every cave within 70 squares of your spawning area. You can use cartograph in cave mode to figure out which ones are unlit. Also light up the surface, unless that is part of your machine. This will force mobs to spawn in your spawn area.
2) Don't stand too near your spawning area. Mobs won't spawn within 30 blocks of you. Not sure if this counts the vertical axis or not. If you need to draw them into your trap, include a safe way to enter/exit the chamber, such as a glass catwalk.
*edit*
Hostile mobs can spawn in at least level 7 light, and most likely 8.
I know that a monster can spawn in the square at the centre of 4 torches placed in a 7x7 square.
ex.
is the darkest point during the night (obviously) and is dark enough to spawn a monster.
monsters will never spawn on these blocks or any blocks outside this area.
I've actually witnessed first hand a monster spawn in this fashion when my courtyard was lit by torches arranged in 7x7 squares in this fashion. I might be calculating incorrectly, but that black square would be at light level 8.
I know that a monster can spawn in the square at the centre of 4 torches placed in a 7x7 square.
ex.
is the darkest point during the night (obviously) and is dark enough to spawn a monster.
monsters will never spawn on these blocks or any blocks outside this area.
I've actually witnessed first hand a monster spawn in this fashion when my courtyard was lit by torches arranged in 7x7 squares in this fashion. I might be calculating incorrectly, but that black square would be at light level 8.
I've tried to confirm this myself, so far with no luck. I got one spider and a creeper to spawn at level 7 light, but as of yet nothing has spawned at 8. Perhaps the likelihood of a mob spawning is influenced by the light level of that square...
I'd be curious as to know if there's specific type of spawns. Such as, above my cave entrance there always seems to be a skeleton or 2 when I leave. Sometimes spiders. I don't think I've experienced creepers or zombies there though.
Underneath by base (it's a tower/sky base thing) there's usually a skeleton ready to shoot arrows at me. Before I lit it up better/had most of the area get blown up by creepers, it'd usually include a zombie. Usually creepers spawn a distance away from the entrance from my base, which means I only really see them when I decide to venture out in the night.
The skeleton underneath my base is probably the most reliable and I will now consider keeping an eye out for where it spawns.
so the ultimate mob killing machine would be to take a 141x141 square cleared out to bedrock.
Then a 31x31 mob killer in the middle, then create some scaffolding so you can lure mobs and just stand in the center of the trap.
course you could always just build a 141x141x101 trap above ground too. But I like the idea of a dark hole of death much more :biggrin.gif:
It's good information nonetheless, now I know why mobs weren't spawning in my previous spawn box, got a large area of caves they must be spawning in instead of my box
you didn't seem to test quantity for modes vs fequency. are already know a minimum of a 3 cube location will spawn give or take a block in each direction from a testing black tunnel mob trap.
I have some anecdotal evidence to add.
I know worst kind of evidence, but may be useful for creating a hypothesis for the chances of mob spawning.
I've been digging mine shafts 2x1 placing torches every 16 blocks on the floor. So there are 15 blocks between them and lowest light level is 6. The shafts are about 100 blocks long.
I've never met a mob wondering in the tunnels. I have found several small caves along the way, filled with monsters.
Could it be that mobs prefer to spawn in darker areas? Or maybe I have just been lucky, maybe the next time I reach the end of a shart (where there is a cross shaft connecting all the shafts) I will run into a creeper.
Keep up the controlled testing.
I'll probably write it up properly one of these days, but for now this will have to suffice.
I've heard a lot of myths and rumors regarding the way mobs spawn and the best ways to capitalize on this. So I've started doing some research. Some of the information was collected via experimentation on codewarrior's CleanRoom map, a massive empty world which consists of one layer of adminium and one layer of wool above it.
The rest was gathered by decompiling the spawning code. There are still a few gaps in our understanding of it, but nothing critical. Special thanks to wabbiteh for helping me work out the algorithm.
Section 1: The Almighty Rules of Mob Spawning™:
1) Difficulty does not affect spawn frequency.
For reals. This has been verified in code. The spawning algorithm makes no check of the difficulty parameter in spawning mobs. Even Peaceful technically has the same spawning rate, though the hostile mobs are removed immediately afterward.
2) Mobs can spawn on man-made materials.
Cobblestone, double steps :stair:, and wool work precisely as well as stone and dirt. They will not spawn on glass or half steps :_:, though. There is no difference in frequency of spawns either.
3)Spawn activity only exists in a 144x144 area around you and not within 24m of you.
Specifically, it happens in the local 81 chunks around the player. The minimum distance mobs can spawn from the player can be described as a spherical bubble with a 24m radius.
Looks like this:
Mobs also can't spawn within 24m of the player spawning point.
4) Large slimes can exist on peaceful.
While they won't spawn on peaceful, they will spawn on any other difficulty. Unlike other hostile mobs, however, slimes won't disappear when switched to peaceful mode, even large ones. If you kill a large slime on peaceful, it won't turn into mini-slimes. Slimes can also spawn at any light level, but only in the bottom 15 layers.
5) Hostile mobs spawn at light level 7 or lower. Friendly mobs spawn at 9 and above, and only on grass.
The light level of a tile is calculated in an odd way. It's base light level is compared against the 4 tiles neighboring it and the air block above it. The brightest of these blocks is considered the main tile's light level. This means that even if a tile is level 7, if any of the neighboring blocks are 8, a hostile mob cannot spawn.
*edit* This expanded sensitivity is only for dirt and half-steps. I have no idea why.
6) The probability of a hostile mob spawning on a specific tile is affected by the light level of that tile (and by properties of the surrounding region).
A random number R between 0 to 7 is rolled. If the light level is ≤ R, a mob can spawn on that tile on that turn, so a pitch dark cave at level 0 will spawn mobs at 175% the rate of moonlit areas at level 4. For reference, torches produce level 14 light, fire and sunlight produce 15, moonlight produces 4, and redstone torches produce level 7. Every block removed from a light source, the level drops by 1.
To understand the regional affects, see section 3.
7)There is a cap of 200 hostile mobs and 15 friendly mobs at any given time.
Once the cap is reached, no new mobs can be spawned until some either die, despawn, or unloaded with a chunk.
8)Placing torches in one room won't affect the probability of mobs spawning in another room.
The exception, of course, is when the population cap has been reached. A mob gets one shot to get placed in a chunk per turn. If a torch prevents it from spawning, it doesn't get to repick its location, so no other location is affected by that torch. In other words, you can't use torches to funnel mobs into a single area.
9)Slime spawns are broken.
All sorts of broken. The algorithm takes the X,Y coordinates instead of the X,Z coordinates to locate the current chunk, on top of a seriously confusing random seeding operation. But fear not. This thread has a patch if you are interested. (Slimes will still be elusive creatures after the patch, just better distributed chunk-wise).
Section 2: The Spawning Algorithm:
The spawning algorithm is called typically 20 times per second. It is executed twice per turn; once for hostile mobs and once for friendly mobs.
Main Spawn Loop:
1) Load all of the 81 local chunks into a semi-random list. (It is not truely random, but a specific order cannot be guaranteed)
2) If the list is not empty, take one chunk from the list.
3) Roll a random number. 1:10 chance proceed to 4), otherwise skip chunk and go back to 2).
4) Chose a mob class at random (for friendlies: pig,cow,chicken,sheep. For hostiles: spider,skeleton,zombie,creeper,slime).
5) Chose a completely random location L1 within the chunk.
6) If L1 is inside a rock or other solid area, bail out of the spawn function completely. Ignore the remaining chunks.
7) If L1 is legal it will be the location of a mob pack, pick 6 locations roughly normally distributed around L1, L(i)
Individual Spawn Loop:
8) Check that current L(i) is unoccupied, has spawnable ground below, and an empty space above.
9) If check fails, get next L(i) and go back to 8).
10) Check that L(i) is 24m+ from (any) player. Also check they are 24m+ from the spawn point. If not, get next L(i) and go back to 8).
11) Prepare mob for spawning (position, orientation, etc).
12) LGT(i) = light level of L(i)
13) (hostile mobs) Roll random R from 0 to 7. If LGT(i) ≤ R, spawn mob at L(i).
13) (friendly mob) If LGT(i) > 8, spawn mob at L(i).
14) If mob class was Spider, roll a random number. 1:100 chance also spawn a skeleton and have it mount the spider.
15) Get next L(i) and go back to 8).
16) When done with all L(i), go back to 2).
17)return
(note: slimes have special rules regarding elevation and light levels, as mentioned in section 1)
Section 3: Discussion:
Assuming you are trying to maximize the number of mob spawns for a harvester or something, there are a few things that should be addressed. The ideal spawning area is like that of CleanRoom: entirely empty space except for a single floor to spawn on. In CleanRoom, mobs spawn so fast that at night it can reach the 200 mob cap within seconds.
The reason for this is that the bailout clause at step 6 is almost entirely avoided as only a mere 0.8% of the locations in the chunks are occupied by solid blocks. Therefore, most of the time all 81 chunks get their chance to spawn a mob pack.
You might think that having multiple floors to spawn on would increase the spawn rate even more, having a larger surface area to work on. While strictly speaking this is true, it also increases the chance of triggering the bailout clause which in the long run is far more harmful.
Assuming most people don't have the resources to dig out a 144x144 pit, the best thing you can do for your spawn rate is to find areas with low elevation and as many caves as possible. The more open air there is, the better the spawn rate will be. Even without mapping out the cave systems you can locate good places. Explore around until you encounter an area with disproportionate amount of mobs. Chances are that area will continue to support a high population of mobs.
Section 4: The Black Magic Spawning Tower:
The chunk traversal order is unique for every chunk the player is in, but there is one exception. If the chunk (0,0) (blocks 0,0 to 15,15) is one of the 81 chunks visited, it will always be the first evaluated. This can be exploited. Regardless of the terrain, there is a 100% chance the algorithm will not bail out before getting to this chunk. This means that chunk (0,0) has the highest chance of spawning mobs than any of the other 8 chunks. It's as high as CleanRoom.
To illustrate this, I built a 19x19x64 tower over chunk (0,0) with 16 spawning floors. After a couple of minutes there were about 150 mobs in the tower, and there probably would have been more if the cap hadn't been reached.
(glass was hacked in with NBTForge for your viewing convenience. Original walls were rock.)
This technique should work on any map, and if I'm not mistaken, SMP, too (as of yet unverified).
To learn how to utilize this trick like a pro, check out Bucyruss's thread on the subject.
I may add a few more things in the future, but this is more or less the final version.
Hope it helps, and happy harvesting.
*edit*
Mobs can spawn in level 8 light or lower. It's possible they can spawn in level 7, but I have yet to see that. For reference, 0 is absolute darkness, moonlight is 4, redstone torches produce 7, regular torches produce 14, and sunlight is 15. Light sources drop 1 level every block removed.
* Spawn rate (how many per minute/night)
* Is spawn rate effected by the number of dark squares in the spawn radius (ie. multiple layers vs. one layer of black)
That's actually a pretty significant find for me, I've always been sure there were more on easy but I guess this shuts me up on that.
Regardless of the time of day, mobs will continue to spawn (fairly quickly) in acceptable locations until the area reaches its saturation limit, after which no new mobs will spawn. I'm still trying to figure out the rules determining the saturation limit.
Spawns are randomly distributed amongst all acceptable areas. If there is only one available area, they will spawn quite densely.
Friendly mobs spawn twice a day, once at dusk and once at dawn. Hostile mobs have no such limitation.
To optimize mob harvesting try these things:
1) Light up every cave within 70 squares of your spawning area. You can use cartograph in cave mode to figure out which ones are unlit. Also light up the surface, unless that is part of your machine. This will force mobs to spawn in your spawn area.
2) Don't stand too near your spawning area. Mobs won't spawn within 30 blocks of you. Not sure if this counts the vertical axis or not. If you need to draw them into your trap, include a safe way to enter/exit the chamber, such as a glass catwalk.
*edit*
Hostile mobs can spawn in at least level 7 light, and most likely 8.
ex.
is the darkest point during the night (obviously) and is dark enough to spawn a monster.
monsters will never spawn on these blocks or any blocks outside this area.
I've actually witnessed first hand a monster spawn in this fashion when my courtyard was lit by torches arranged in 7x7 squares in this fashion. I might be calculating incorrectly, but that black square would be at light level 8.
I've tried to confirm this myself, so far with no luck. I got one spider and a creeper to spawn at level 7 light, but as of yet nothing has spawned at 8. Perhaps the likelihood of a mob spawning is influenced by the light level of that square...
Underneath by base (it's a tower/sky base thing) there's usually a skeleton ready to shoot arrows at me. Before I lit it up better/had most of the area get blown up by creepers, it'd usually include a zombie. Usually creepers spawn a distance away from the entrance from my base, which means I only really see them when I decide to venture out in the night.
The skeleton underneath my base is probably the most reliable and I will now consider keeping an eye out for where it spawns.
Then a 31x31 mob killer in the middle, then create some scaffolding so you can lure mobs and just stand in the center of the trap.
course you could always just build a 141x141x101 trap above ground too. But I like the idea of a dark hole of death much more :biggrin.gif:
It's good information nonetheless, now I know why mobs weren't spawning in my previous spawn box, got a large area of caves they must be spawning in instead of my box
Clicks would be much appreciated
I know worst kind of evidence, but may be useful for creating a hypothesis for the chances of mob spawning.
I've been digging mine shafts 2x1 placing torches every 16 blocks on the floor. So there are 15 blocks between them and lowest light level is 6. The shafts are about 100 blocks long.
I've never met a mob wondering in the tunnels. I have found several small caves along the way, filled with monsters.
Could it be that mobs prefer to spawn in darker areas? Or maybe I have just been lucky, maybe the next time I reach the end of a shart (where there is a cross shaft connecting all the shafts) I will run into a creeper.
Keep up the controlled testing.
HeroineHerobrine Addictions..Thanks, and if this gets more information, I might want to add a link to the FAQ thread. :biggrin.gif: