mojira.dev
MC-64036

Bed item appearing when right-clicking a bed in the nether

The bug

In the nether, when you right click on a bed no matter what is in your hand, a bed item will appear out of nowhere. This is a somewhat bed generator.

Expected behavior would be that the bed blows up like normal and not drop a bed item.

How to reproduce

This can be done in creative, survival, or adventure

  1. Go to the nether

  2. Place a bed

  3. Right click it

  4. A bed item should appear coming out of the bed

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.block.BlockBed.onBlockActivated(World, BlockPos, IBlockState, EntityPlayer, EnumHand, EnumFacing, float, float, float) moves the position to test and interact with to the head of the bed. The problem is that when you right click the bed in the nether it first sets this position to air. However, the method net.minecraft.block.BlockBed.neighborChanged(IBlockState, World, BlockPos, Block, BlockPos) drops the bed item if a bed foot part is without a head part.

Therefor the method onBlockActivated should place both parts without causing block updates and after that cause for the neighboors of the blocks it replaced the block updates.

Linked issues

Attachments

Comments 9

Confirmed for 15w46a

Confirmed for 1.9

Still in 1.9.1-pre3

Still in 1.9.3-pre2

The item isn't appearing in 1.13.1, however there's a breaking animation.

If this issue is about the bed item always dropping, then it is indeed fixed. Is there something else?

C-Dude Zoki

(Unassigned)

Confirmed

bed, drop, explosion, item, item-drops, nether

Minecraft 14w30c, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.2-pre1, Minecraft 1.8.8, ..., Minecraft 1.9.3 Pre-Release 1, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2

Retrieved