mojira.dev
MCPE-99315

Mobs cannot spawn on south or east slopes or in 1-wide tunnels made of solid blocks

Mobs cannot spawn at a given X, Y, Z coordinate if there is a solid block in the -X or -Z direction. This is likely because the game attempts to spawn the mob at the bottom-north-west corner of the block and therefore detects collisions with blocks to the north or west. As a consequence, no mobs can spawn at all on southern or eastern slopes that are 45 degrees or steeper. This makes for an unnatural distribution of mobs in worlds, with barren zones and overly dense zones. It also limits the possibilties for mob farms and/or limits farm efficiency.

Steps to reproduce

  1. Open the attached test world.

  2. Over one hill and then the other, fly up between the command blocks until you hit the glass, then look down and observe spawns.

  3. Use the command blocks to alternate day and night, kill all mobs, or send up signals to help locate the mobs (especially in the water).

  4. Note where mobs spawn over several trials. The red glass marks north.

Expected result

Mobs spawn all over each hill with uniform distribution.

Actual result

Mobs only spawn on the north and west slopes.

Related issues

Attachments

Comments

migrated
[media]
racartwright

This is a long standing game mechanic and changing it, while making the game act more reasonable, has the potential to break two types of farms. (1) Farms that use instapush mechanics and (2) really advanced farms that take advantage of mobs spawning in the middle of four blocks.

For mob farms, this mechanic can be worked around by constructing the walls of the farm out of ice or glass which don't prevent most mobs from spawning if they collide with it.

The cause of this mechanic is that mobs spawn according to block positions. Block positions are integers, and mob positions are floats. When the block position is converted to a mob position, the integer coordinates are converted to floats. This means that the bottom of the feet of the mob are centered at the lower-north-west vertex of the block the mob's feet spawn in. Now MobSpawner blocks add 0.5 to the their x, y, and z coordinates to center their spawning in the center of the block, but the Environmental Spawning algorithm doesn't include the adjustment.

If a decision is made to change mob spawning, I recommend that the spawning position be adjusted by a number slightly under 0.5, so as to not impact instapush mechanics. The offset of 0.499938965 would work reasonably well. It's close enough to 0.5 that it will probably not be noticible, but would allow mobs to be pushed in the same directions they currently are when spawning. This would preserve instapush mechanics for farms built within 16k blocks of 0,0.

Invisible826

The fix of this in 1.21.0.20 seems breaks lots of existing creeper farms: buttons in a grid pattern with 1 block in between would no longer block spiders from spawning.

Changing the spawning requirement for spiders from 2x2 to 3x3 may fix this, but it may bring some new side effects.

migrated

That was not a cool thing to do. Thanks for ruining farms

mikeclueby4

Fwiw, I think it's cool that Mojang dared to make this change.  I'm getting a fair few farms broken myself – but I'm good with that.  Designing new things is fun!   And this change makes all sorts of sense. 

GoldenHelmet

(Unassigned)

434631

Confirmed

Multiple

java-parity

1.17.11 Hotfix, 1.16.21, 1.16.40 Hotfix, 1.16.100, 1.16.201 Hotfix, ..., 1.18.12 Hotfix, 1.18.30, 1.19.30, 1.19.62, 1.20.0

1.21.0.20 Preview, 1.21.0

Retrieved