mojira.dev
MC-3599

Sleeping in beds above layer 128 in multiplayer causes the player to fall into the void (visually only)

Sleeping in a bed above layer 128 causes what I think is a client-side signed integer overflow, setting your y to ~-128 and causing you to fall from there. Leaving the bed works as expected.

Linked issues

Attachments

Comments 16

Unable to reproduce. Can you attach a screenshot of your setup?

After a little further testing, it doesn't appear to affect single-player. Added a screenshot as requested.

Can confirm for SMP.

The screen doesn't fade out, it instantly blackens.
When leaving the bed in the morning the player gets damage.

I've never received damage in the morning from this bug. What is your test environment?

My setup is quite unspectacular. Height is 155, two beds, the chickens do not play any role 😉
When sleeping the y coordinate falls to -500 and when the night is over I'll get a little damage.

6 more comments

Still in 1.7.4 (vanilla client, bukkit server) and even worse than before now that it is common for terrain to generate up this high. Tried to sleep on top of a mountain and it appears that I fell into the void so I pressed Leave Bed and luckily appeared back on land but with the "crunchy knees" damage sound.

EDIT: This is probably because Java's "byte" is a signed -128 to 127, so when it teleports the player from the position they right clicked the bed from to the position of being on the bed, the y coordinate has an overflow. I would be curious if putting a bed at y=256 would teleport you to approximately y=0 when you were sleeping.

Affects 1.7.5, Fixed in 08a

I can confirm it's fixes in 14w08a

Apeiron

(Unassigned)

Confirmed

Minecraft 1.4.5, Minecraft 1.4.6, Snapshot 13w04a, Snapshot 13w05b, Snapshot 13w06a, ..., Minecraft 13w48a, Minecraft 13w48b, Minecraft 13w49a, Minecraft 1.7.3, Minecraft 1.7.4

Minecraft 14w08a

Retrieved