When using a debug stick onto a bed, it doesn't work: The game thinks you want to sleep and doesn't modify any property. (Clicking with the left click works, but not with the right click).
Environment
GTX 1050, Intel I5 3470, 1920x1080 165fps, 8 Gb(4Gb allowed to Minecraft), Java Version
You have to sneak