Minecraft wiki entry for Traps, associated text: Connect a bed next to a Observer, the Observer to some TNT, and cover the whole thing in cobblestone. Then just wait for the player to sleep in it and get blasted sky-high.