Bed

Beds are a block that allows the player to skip to the next dawn. Beds also set your spawn point to the location of the bed. If the bed is destroyed, the spawn point resets.

In SMP, the server will only skip to dawn when all online players are sleeping, or when only one player is online, otherwise it shows a first-person view of the player lying down, and a "Leave Bed" button.

Crafting
''Note: You can use any color of wool. You can even use multiple colors of wool, but the bed will remain red. The only way to change the bed color is to change the 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 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 or glass, but can be placed on 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 like with fences, or for beds to be placed on blocks that they cannot be directly place upon.

Beds cannot be placed underwater. They can be placed in a dry area and then flooded, but they cannot be slept in.

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 onto other blocks at the bed's level.

Behavior
Beds are used by right clicking the bed during the night. Attempting to use it during the day will result in a "You can only sleep at night." message, which also appears when attempting to use beds underwater. However, when attempting to use a bed in the nether there will be a dynamite-like explosion when right clicked. this can be very useful for mining netherack. When used, the player is positioned in the bed and their view slowly fades to gray. After this transition, the player wakes up at dawn. If the player were to die, the bed last used will serve as the new spawn point. However, if the bed is removed or there isn't a 1x2x1 empty space next to the bed, the message "Your home bed was missing or obstructed." will display and the spawn point will be reset to the default. Compasses never change their orientation, remaining pointed towards the original spawn.

If a hostile mob can get within 2 blocks of the bed, even if the blocks are separated by a wall, you will be awakened with the hostile mob standing next to you. There appears to be a slight delay before the mob attacks you, giving you time to get the first blow.

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.

Beds placed in the Nether will explode when the player tries to sleep.

Multiplayer
To skip the night, all players on the server must be in bed at the same time. Players can also chat while in bed, and have the option to leave the bed before the skip happens.

If you try to sleep in a bed occupied by another player, you will get the message "This bed is occupied."

In order to change your respawn point in multiplayer, you must click the Leave Bed button before falling asleep. Sleeping all the way through the night will not change your respawn point.

Safe outdoors bed: in case of emergency
If you ever get lost in the woods and it turns dark, you can sleep in a bed without building a shelter first. The trick is elevation.

You will need at least 5 dirt, 1 bed; or as described earlier 3 wool and 3 planks and 1 Crafting Table

The empty 3rd block of the 'overhang' is required to wake up safely, and to be able to place the bed.

In case you are not proficient with sneak or putting down blocks while jumping up; alternatively you can make a crude stair using 3 additional blocks but remember to remove the top of the 2 high stack so monsters will not be able to reach you.

Trivia

 * You can still press inventory key after entering a bed to access your inventory and 2x2 crafting slots.
 * Because of this, you can craft while asleep.
 * Sneaking while asleep will show the inside of your characters head. You will see his face from inside his head.
 * In SMP, you can view other players in bed. The player avatar clips just slightly into the bed if they have something in their hand and his feet protrude off the edge.
 * When walked on, beds make a footstep sound similar to the block below. If the block below the bed is removed, it will still make the sound of the block that was previously under it.
 * If there is a solid block above a bed, the surface of the bed will become black, much as with slabs.
 * Placing a bed next to cactus in SMP creates a detached headrest. This can be used to create heart shaped beds and benches.
 * On peaceful mode, a bed can be used out in the open, as no monsters are present to interrupt your sleep.
 * You can get pushed off the bed, this won't alter the sleeping in any way.
 * If placed in or near a dungeon, mobs will spawn even if the spawner is deactivated by torches, and the bed is in a safe place.
 * Since you do not need to stand on a bed to use it, beds can be used as one way transportation. Using the bed through a 1x1 hole will transport you to the other side of the 1x1 hole upon waking up.
 * You can sneak walk off beds, being slightly taller than half-steps.
 * Beds cannot be destroyed by fire.
 * In Beta 1.4, the player could only set the spawn by pressing the Leave Bed button in SMP. This was fixed in 1.4_01.
 * As of Beta 1.6, if you try to sleep in the nether, the bed will explode. Before this version, you would just see the message "You can only sleep at night."

Bugs

 * 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 on the foot instead of the head of the bed.
 * 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.”
 * If you right-click while standing on the bed in SMP, the message "this bed is occupied" will appear. You are technically in the bed but you can walk around, and you will appear lying down to other players.
 * 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.
 * In multiplayer, many situations can cause you to be kicked from the server for an “Illegal stance”:
 * Going to bed while sneaking.
 * Going to bed right between sunrise and day.
 * Being pushed off the bed into a block. (This will sometimes kick the pusher as well.)
 * 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.
 * When a user right-clicks quickly enough in Single Player, the message "This bed is occupied" will appear on the screen. This was the third message that could be seen in Minecraft Single Player Mode and it can even be displayed twice if the user right-clicked fast enough.
 * 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 possible 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 you sleep with the door open, your house will be unsafe and mobs will always spawn unless you destroy and replace the door.
 * 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.
 * If you use your bed, and have a door with a right hinge (as viewed from the outside), monsters can still get to you and wake you up, as though no door was present. One example of this is a room with double doors, atleast one of the doors will be unsafe.
 * 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. This also cancels the sleeping animation, making it still night time.