Minecraft – (How) does carpet affect mob spawning on slabs/glass

minecraft-java-edition

The Minecraft Wiki says carpet doesn't prevent mob spawning. But does it affect mob spawning on blocks mobs normally don't spawn on? If I put carpet on glass or slabs, can mobs spawn there?

Best Answer

Update for 1.8 and after

Update 1.8 added a 1/16 meter high hitbox to carpets, which made natural mob spawning on carpets impossible. Carpets are now safe.
Thanks @TomášZato for bringing this up!

(There still are some types of "unnatural" spawning that are able to force mobs into carpets, like Village Sieges.)


Before 1.8

Carpet both does not prevent and does not facilitate mob spawning, but it does help in a way.

Carpet is a non-solid block, so, in terms of algorithm, mobs do not spawn on carpets, but rather in. Basically, you can replace all carpets with signs for the same, but more obvious, situation.

Mob spawning alrotihm, simplified, is the following:

  1. Pick a totally random place (in 3D, not only on the surface) to spawn a pack. It must be a block of air (not carpet).
  2. Try to spawn several mobs around the pack on the same height. Block underneath must be solid, and the block mob spawn in may be any non-solid block, like a carpet.

What it means regarding carpets: if you have a level floor in a room, and room is surrounded by solid stone, no mobs will spawn even in the dark, as there are no air blocks on floor level. If you have a building surrounded by air, though, mobs will be able to start spawning outside and "leak" onto your carpet floors.

So, glass floors are as safe as they ever were.

Detailed algorithm is on the wiki.