The bug
Trying to sleep in a bed often can cause the player to fall out of it. The fall direction depends on the layout of the ceiling. One example to reproduce the bug is attached here as a screenshot but there are a lot of different layouts that cause the problem.
The bug is probably caused by some part of the game code thinking the player is still standing (on the bed) and intersecting the ceiling so it tries to move it out there.
Related issues
is duplicated by
Attachments
Comments


Confirmed in 1.4.2 pre-release, the player will appear to fall or roll out of bed, as if being pushed out of a block, when they lay in a bed below blocks.

Played with it. Weird effect! I made a very tall tower with bed with block above it. could sleep in it, but fell off. I feel long way down but didn't stand or even get hurt. But when I woke up, I fell off bed AGAIN but this time died. lol

Confirmed, player falls out of bed, but sleeping still works.

Other weird effect is that you can sleep while flying. However if this bug happens, you fly off into air. When you wake up, you will fly off again.

same situation in 1.4.6-1.4.7
in multiplay, when i am in bed, it seemed to be nomal by others, but in my sight,
i fall of with heading crossed direction with bed.
also presure plate not activated whenever the player fall.

Can we get a confirmation of whether this happens in 13w10a and an update to the affected versions?

Confirmed 1.5.1

Just noticed this bug for the first time in 13w16a, so I confirm it occurs there. It occurs whenever I sleep in a bed which is in a room with a two-block-high ceiling (which seems a natural thing for a player to do on their first day when they've made a quick little hole-in-a-hill shelter).

Still in 1.6.2

I can confirm this happeing in 1.7.2, though 2-high ceiling isn't the problem in my case. I have recreated my bedroom area on my testing map (see screenshots) and I spammed sleeping in bed. I get thrown off the bed mainly because of the walls and probably because of the chest and I always face North, though coordinates still say the bed direction (in this case East). I've also tested this with nothing around the bed. You actually have a one-block-high drop on a bed (and maybe a small side offset), when it occurs, thus hitting a wall or ceiling will result sleeping on floor.

Is this still a concern in the latest Minecraft version 14w02c? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Reproduced in 14w02c.

Confirmed for 08a

Confirmed for 1.7.5 and 14w10c

Confirmed for 14w28a.

Confirmed for 14w28b

Confirmed for multiple directions in 1.8.1-pre2.

Tested in 1.8.4 and it appears to be client-side as Steve cannot trigger pressure-plates, take damage, or enter portals by falling inside them while sleeping. Further testing underway.
EDIT:
Confirmed to be client-side as command-blocks see you as being in the bed even though you've "fallen out of bed"

Confirmed for Snapshot 15w31a

Confirmed for 15w44b.
To reproduce, simply build a ceiling like the one in the first screenshot above the bed and try to sleep in it.

Confirmed for snapshot 15w47a

Confirmed for 15w47b

Confirmed for 15w49a

Confirmed for 1.8.9 and 15w51b.

Confirmed for 16w02a.

Confirmed for 16w03a.

Confirmed for 1.9-pre1. It affects coordinates shown in F3 as well.

Confirmed for 1.9-pre2

Confirmed for 1.9.0

Confirmed for 1.9.1-pre3.

Confirmed for 1.9.3-pre3.

Confirmed for 16w20a.

Confirmed for 16w21a.

Confirmed for 16w21b.

Confirmed for 1.10-pre1.

Confirmed for 1.10-pre2.

Confirmed for 1.10.

Confirmed for 1.10.1.

Confirmed in 1.11

I think that this is caused by the sleeping player's hitbox not changed.

I can confirm this in 1.12.1.

Affects 18w11a

Affects 18w14a

Affects 18w16a

Affects 18w22c

Affects 1.13-pre1

Affects 1.13-pre2

Affects 1.13-pre3

I can vouch that this issue affects 1.13-pre3 tested in igloos.

Affects 1.13-pre4

Definitely affects 1.13 official release.

Affects 1.13.1 release