Do buttons/levers above rails prevent zombie pigmen from spawning?
I was watching a live stream of someone creating a railway through the Nether when it was suggested to him to prevent zombie pigmen from spawning on his rails by placing button on the space above the rails (either attached to the ceiling or the wall).
Having never seen buttons being used for that purpose I started researching it a bit. Buttons do count as transparent blocks, but mobs can spawn on pressure plates, so perhaps redstone components are an exception. The relevant question on this topic on Arqade did not list them specifically in the answers (see Is there a way to keep Zombie Pigmen off of minecart tracks in the Nether?).
Best Answer
For anyone wondering, mobs can not spawn on buttons in 1.9. The previous answer was from 2015, before 1.9 was released.
According to snapshot 15w46a for update 1.9 that was released in 2016:
Mobs can no longer spawn inside blocks that block movement but are transparent, such as leaves.
Mobs can no longer spawn in blocks containing rails, powered rails, detector rails, or activator rails.
Mobs can no longer spawn in blocks containing buttons, tripwire hooks, pressure plates, levers, redstone torches, redstone repeaters, comparators, or redstone dust.
Pictures about "Do buttons/levers above rails prevent zombie pigmen from spawning?"



How do you stop Pigmen from spawning on rails?
The way to ensure no pigmen spawn on your nether rail is to place glass above the rail. This is not a bug/exploit and will not be \u201cfixed\u201d. Glass is a transparent block and will not suffocate the riders, but you will need to clear out any areas you may wish to exit the cart at.How do you stop zombie Pigmen from spawning?
There are several ways you can try to stop Zombie Pigmen from spawning in the nether by breaking their spawn rules:Do buttons stop mobs from spawning in the nether?
Mobs cannot spawn on buttons, levers, pressure plates, and all types of rails.What blocks can zombie Pigmen not spawn on?
Zombified piglins do not spawn on top of nether wart blocks.Spawn-Proofing Your Nether Hub! ▫ The Minecraft Survival Guide (Tutorial Lets Play) [Part 173]
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Charlotte May, Klaus Nielsen, Karolina Grabowska, Karolina Grabowska
