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
Go to the nether
Place a bed
Right click it
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.
Confirmed.