Bed

A Bed is a block (actually two blocks per bed) that has two functions: They allow the player to sleep through the night and skip to the next dawn, and they reset the player's spawn point to within a few blocks of the bed. In multiplayer, all present players in the Overworld must be in a bed for the world to skip to dawn.

If a player's bed is destroyed and the player dies, a message is displayed saying "your home bed was missing or obstructed", and the player will respawn at the original spawn point. Keeping this in mind, the player should keep their "base" near the original spawn or know how to navigate to that base from the original spawn.

Crafting
Note: Neither the color of the wool nor the type of wood used has any effect on the bed's appearance. The only way to change the colors is with a texture pack.

Placement
Beds, unlike typical blocks, take up two blocks of space. Placement requires at least this much space away from the player's facing direction. When placed, the foot will be placed on the block selected and will face toward the user. Two or more beds can be placed next to each other, effectively allowing double beds. Like certain other blocks, beds can not be placed on snow, ice, glowstone, glass, or (as of version 1.0) leaves. If you remove the blocks underneath the bed, the bed will not be removed, but will remain floating. The floating bed method allows beds to be placed over each other and on blocks you can't normally place them on.

Beds are 9/16 of a block high, one more pixel than half a block. This prevents you from walking onto the bed from one level below the bed without jumping, but allows you to walk up onto other blocks while on top of the bed

Obstruction occurs unless there's a solid block (the same restrictions apply as the bed itself) at 'floor level' with 2 air blocks above it in one of the ten blocks that surround the bed. It doesn't matter if the bed itself has blocks above it. In other words: in order to work the player must be able to stand next to the bed at the same level as it, on a type of block that a bed could be placed on.

Sleep interruption
In old versions of Minecraft, sleeping in a "vulnerable" bed would cause the player to wake up early with a skeleton or zombie spawned next to them (referred to as a "nightmare"). A bed was considered vulnerable if it was placed in an area that passing monsters could access, with a generous definition -- merely placing beds next to external walls would also cause this.

In recent and current versions of Minecraft, nightmares are gone, but you cannot sleep if a hostile mob is within 8 blocks of the bed. If a monster is nearby, even through a wall, the message "You may not rest now, there are monsters nearby" will be displayed and the player will not be able to sleep until the monsters go away or are killed.

Behavior
Beds are used by right clicking the bed during the night. They can also be used during thunderstorms but not during rain or snow. Attempting to use a bed at any other time will result in a "You can only sleep at night" message.

If all sleeping requirements are met and the player enters a bed, the player will be positioned in the bed and the screen will slowly fade to black. During this time, the player can leave the bed by clicking the "Leave Bed" button. Once the player has entered the bed, the spawn point is set near the bed.



Sleeping only changes the time of day to sunrise; it does not speed up processes which take place over time such as the decay of dropped items, plant growth, and smelting. However, if it was raining or snowing, the weather is likely to end overnight. If the player went to bed late in the night (after monsters have spawned), they will be able to collect the drops from sunburnt undead, and easily kill off a few stragglers. Of course, there may also be creepers about, but those despawn faster than the items do.

Beds placed in the Nether will explode when the player tries to sleep, and set fire to surrounding blocks. The bed will drop as a resource, and may be picked up and placed again. Some have suggested that this could be used for mining in the Nether, but this would be excessively hazardous: Given the point-blank range, the explosion may well kill even an armored player. Placing a bed in The End and sleeping in it will explode as well, including setting the surrounding area on fire.

Multiplayer

 * To skip the night, all survival-mode players in the Overworld must be in bed at the same time. However, players in The Nether or The End don't have to sleep for this to happen (there is no day/night cycle in either of these dimensions), nor do players in creative mode.
 * Players can also chat while in bed, and can leave the bed before the time-skip (thus blocking it for everyone).
 * If you try to sleep in a bed occupied by another player, you will get the message "This bed is occupied".

Safe outdoors bed: in case of emergency
If you ever get lost in the woods when it turns dark, you can safely place and sleep in a bed to skip the night. You should however build a minimal shelter for safety, in case some monsters have already spawned nearby. There are two common methods for this:

(1) Dig out a small space (just big enough for you and the bed) underground, cover over the entrance, and optionally place a torch. Just dig straight down 3 meters, then dig a 3x1x2 space from your current location. See below for a diagram.

Add a torch, and cover the entrance.

Place your bed.

When you wake up, dig 1 block up so you see the surface, then remove the torch, pick up your bed, and build a way to the surface.

(2) Alternatively, you can use pillar jumping to make a pillar, then add a platform on top for the bed.

Make your pillar at least 3 blocks high (the taller, the safer). Then place a total of 5 blocks around the top block in all directions, making one side two blocks long. (Using to crouch will let you lean over the block edges without falling, to place the side blocks.)  The 3 extra blocks around the pillar is an overhang to prevent spiders from climbing up. Place your bed on the 2-block ledge.

Bugs
Beds, if destroyed on some servers will glitch and leave the half of the bed that was not broken by the player. 
 * Placing a bed down underground with two glowstone blocks above it will allow you to sleep in the bed but when you wake up or leave the bed will allow you to see any nearby caves.
 * In multiplayer, you are unable to sleep unless others around you sleep too. However, if the other players are more than 500 blocks away from you, you are able to sleep. This results in created time zones in different areas.
 * If you try to use a bed with an ender pearl in your hand, you will receive the "This bed is occupied" message
 * If you try to place a bed above the height limit for the map, it will be lost from your inventory.
 * Hitting the bed will cause the top surface to brighten. This does not affect the light level, and it is probably a glitch in the breaking animation.
 * Many situations cause a “You can only sleep at night.” message, even if it is nighttime. These have been reported to include:
 * The bed being surrounded on all sides by blocks, or water.
 * Right-clicking the bed while standing on top of it or more than three blocks away.
 * The bed seems to only force the camera to be in the bed; while the screen is fading out, you can still move around, break/place blocks, fire arrows, etc., but cannot see where you are or see your arm/tool. This has been called “sleepwalking.”
 * Moving the mouse around will cause particles on the screen to face different directions. This is because they are sprites, images that attempt to face the player's eyes (which aren't actually at that location) to avoid being seen edge-on.
 * There is a glitch in SMP where, if you switch from two beds rapidly (possibly due to connection), you can enter one bed and leave to appear near a different bed.
 * Using a bed in a room with a low ceiling can result in the player waking up with their head stuck, causing them to suffocate unless they can escape, which is likely after sneaking while using a bed.
 * In SMP, if a player gets into a bed and then another player surrounds the bed with a solid material (e.g. cobblestone), the first player will be stuck in a laying down position upon attempting to get out of the bed.
 * Saving in a bed and then continuing that saved game causes the player to fall through the floor and makes the bed "occupied." This can be fixed by destroying and then replacing the bed.
 * Sometimes if you place a bed next to a wall, it will spawn you on the other side of the wall.
 * Beds can be used to sleep through thunderstorms even during the day. It's because that the condition that must be met in order to sleep is not that it is nighttime, but that the ambient light is below a certain threshold.
 * If the bed is clicked on while holding a bow with arrows in your inventory, you will fall asleep and as if an invisible copy of the player is standing where you were, arrows will fire from that spot, fall through the bed and be lost forever. The arrows will not damage you.
 * If you walk very far away from your bed and then die, you do not re-spawn at your bed and instead spawn at your original spawn point, receiving the message "Your home bed was missing or obstructed".
 * Sometimes when sleeping in a bed completely surrounded by torches (including corners) you will have fallen through the bed when you wake up and begin to suffocate.
 * When sleeping in a bed, if you look down (it won't adjust the looking angle though) and destroy the bed while sleeping in it, you will hurt your self for 1/2 of a heart. No damage will be inflicted if you are playing in peaceful mode. In addition, if you are next to a 2 or more block high wall when this happened, you will be able to walk into it to a certain extent, just enough to suffocate you. if you are in 3rd person, you will switch to first person automatically when walking into the wall. This also cancels the sleeping animation, making it still night time.
 * You cannot respawn back to a bed surrounded by half-height blocks ("Your home bed was missing or obstructed")
 * If you place a bed on a glass floor (through placing the bed on normal blocks and then replacing the normal blocks for glass blocks) then when you die you will be placed back at your spawn point with the message that says "Your home bed was missing or obstructed."
 * If there is block of air between a bed and a big chest above it, and you try to go to sleep, you appear to be pushed out of bed, then sleep on the floor next to you.
 * If you sleep in a bed over the 128-block height limit in pre-releases 12w07a and higher, you appear to be falling in The Void.
 * In SSP, you can interact with the environment when in bed.
 * This includes placing/breaking blocks and using chests, crafting tables, and furnaces.
 * Trying to use the same bed again will cause the "This bed is occupied" message to appear.
 * If you destroy your bed before you finish the sleep animation, you will stand up, but whenever you jump you will take damage, and walking into ladders will suffocate you. This can be fixed by placing your bed again and sleeping or by exiting the game and rejoining.
 * In SMP, if you sleep in a bed to set your spawn point but then break the bed and die, there is a chance you will not go to the original spawn, but rather a new spawn point will be created far from the original. There is no way to reset the spawn back to the original point without mods. (From some testing, it seems that the spawn point is reset to (0,Y,0).)
 * While using the "Quake Pro" FOV level, you can see the inside of your head while sleeping.
 * In Single Player Creative, you can sometimes move your bed while sleeping. This happens often if you sleep in a stronghold/cave with a stronghold nearby, and it is unknown why this happens.
 * At night if your hunger bar is low and you are dying, if you sleep then your health bar will stop lowering and you will not die.
 * In Creative Mode, destroying the foot of a bed will yield no item (as normal). However, hitting the head of the bed will result in the drop of a bed.
 * If a bed a player is sleeping in is broken, the player will have clipping issues and be able to partially walk into walls and take suffocation damage.
 * If you sneak while in a bed, you can see your head and body in a strange way.
 * You can sleep near a Ghast, Slime and a Magma Cube even when they are within 10 blocks of the bed, despite that they are hostile mobs.
 * Walking from a slab to a bed will cause the view to drop for a split second as if you walked off the slab to the block below.
 * If there is a wall on one side of the bed and a ladder in a 1x1 hole on the other side, you will fall down it while sleeping.
 * You can teleport to people in SMP while sleeping if the recipient is not, and you will appear to be lying down when you are teleported.
 * You cannot set beds on slabs that occupy the top half of the block.
 * All mobs can push you out of your bed, but you'll still sleep.
 * If you break the bed as you are sleeping, you will be able to walk through blocks and water as if there is nothing there.
 * When you place a bed in a 1x2 hole in your floor, when items are dropped onto the bed (if it's in a 1x2 hole in your floor), they can't be collected and to fix this, destroy the bed, collect the items and then put the bed back again (useful for SMP, so that players won't collect your items).
 * If you place a bed down and surround it by redstone wire, you will not spawn on the redstone. If you do this and there is a wall around the redstone, you will spawn within the wall and suffocate to death. If you die this way, you will spawn at your original spawn location, with the home bed being "missing or obstructed."

Trivia

 * You cannot create a redstone trigger to go off when you respawn with a bed. Using a pressure plate next to a bed will make you respawn in the next available spot. Surrounding the bed with pressure plates will say "Your home bed was missing or obstructed".
 * Unless you use redstone ore and hook it up to a BUD-switch.
 * Beds can be placed at the height limit. However, they cannot be used.
 * When walked on, beds make the sound of stone.
 * Although they are taller than slabs, they can be walked off when sneaking.
 * Beds cannot be destroyed by fire.
 * If the player falls from high enough to take damage, but right click on a bed before they hit the ground, they won't take fall damage until leaving the bed.
 * This also happens with minecarts.
 * If there is a solid block above a bed, the surface of the bed will become black, much as with slabs.
 * There is a glitch that can occur if there are two Stone Brick blocks above the bed. Upon sleeping in the bed, the player will appear to be lying on the ground.
 * The bed appears to glow slightly while being destroyed.
 * Beds have the widest varieties of different blocks that can be use to craft them. Any type of wool or wooden plank can be used to craft it.
 * While sleeping, the HUD will start to fade, but the level number will not.
 * The command can be used to get the foot of the bed. The command is . If you place a pressure plate next to this foot of the bed, and step on the pressure plate, the block will break but you will get a full bed back. Also, if you place two of these blocks together, they will act like a full bed, but appear like the bed has two feet.
 * Beds (besides doors and pistons) are the only thing in creative mode you can destroy and get back. (As long as you hit the "pillow" part.)

Sleeping
 * If the world is quit while sleeping, on returning the player shall be awake beside the bed.
 * Mobs or other players can push sleeping players off their beds; this won't affect the sleeping in any way.

SMP
 * The player avatar clips just slightly into the bed if they have something in their hand and their feet protrude off the edge.
 * Using the /tp command while another player is sleeping will still teleport the sleeping player. The player will then appear sleeping on the ground; this won't affect the sleeping in any way. The player will wake up next to the bed.