The bug
Drop an anvil on a bed. You can still sleep in the bed when you shouldn't be able to. This also works with other things such as pistons, blocks, enchantment tables, etc. As of 1.4.6, you are tossed aside with blocks atop beds, yet you are still allowed to sleep.
A solution for this could be to introduce an "obstructed" blockstate to beds, which applies when certain blocks are above it. Obstruction already happens with solid blocks. Logic like this could also be extended to chests and other blocks, causing them too to display hotbar text to guide new players.
Related issues
is duplicated by
relates to
Attachments
Comments


Can you still sleep in the bed, when the anvil is dropped at the head section of the bed ?

Tested. You can still sleep and set spawn when anvil dropped at head section.

You can still sleep. When your sleeping the anvil also shows too.

The third picture now shows what it looks like sleeping with the anvil on the head section.

Perhaps the anvil in not considered to be 'in the way' because it is an entity?

It doesn't even matter if it's an anvil, you can sleep even when there are 2 dirt blocks right above the bed.

Should I adjust the title and summary then?

Yes do this please.

Confirmed.

I do believe a more definitive title would be "Sleeping with Blocks Atop Beds"

bump

@Bob Joe: Please stop bumping, this ticket is still open.

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

Still a concern in 1.7.5 and 1.8.

Confirmed for 14w18b.

Cannot confirm in 1.8.2-pre1.

Confirmed in 15w47c.

Confirmed for 1.9-pre1

Confirmed for:
1.10 pre releases
1.10
1.10.1

Do I understand that correctly? It's not supposed to be able to sleep with blocks above the bed and that is the bug here?
Can confirm for MC 1.12.1. Anvil can't be dropped from higher than one block though.
Confirmed for 18w30b
Confirmed for 18w31a

Affects 18w47a

Affects 18w47b

Affects 18w48a

Affects 18w48b, can I request ownership of the ticket?
Gave the ticket to @unknown.

Confirmed in 1.16.1

Confirmed in 20w27a

In 20w29a
Can confirm in 20w48a.
Can confirm in 20w51a.
Can confirm in 21w05b.
Can confirm in 21w06a.