Bed occupied flag not reset after server reboot.
What I expected to happen was...:
when I was ejected from bed after server reboot, I would be able to get back into bed
What actually happened was...:
in bed during server reboot, log back in, no longer in bed. try to sleep, "bed is occupied"
Steps to Reproduce:
0. make sure you are not near villagers or other players who may get into bed
1. get in bed during server night
2. reboot server
3. I am not yet sure if it needs to be day to kick you out of bed
4. be kicked out of bed when logging in
5. try to lie in bed at night
6. server responds, "bed is occupied"
workaround
break bed and replace, remember to lie in bed before next death
Attachments
Comments 7
bug appears to still exist 1.16 Release Candidate 1.
I have made new discovery, the above test must all be done at night
Steps taken to test bug:
0. broke and replaced bed, bed is far from villagers
1. got in bed at the beginning of server night
2. reboot server from web console
3. Immediately log back in, still night (above ground in these later tests so I could see the sky)
4. logged in and was kicked out of bed
5. tried to lie in bed immediately
6. server returns "bed is occupied"
When I waited for day before logging in. bed was normal
so order of operations,
server must be reset after going to bed, but before getting out.
player must then log in immediately and be kicked out of bed due to server restart, rather than due to daytime. (logging in on a subsequent night fixes the issue)
when player tries to sleep again, bed will still be occupied
notes:
when trying to sleep the next night, after bed is locked, bed is still occupied.
logging out, then in, bed is still occupied
broke bed, lay in bed, reset server, waited 20 mins so it is a later night, then logged in. bed behaved normally.
1.16.2
1.16.3
1.16.4
1.16.5
All tested, same results.
If you want a work-around, kick all players before the server restarts – not posible if the server crashes though.
I'm sure a workaround can be made using a datapack to set the nearest bed to the player's respawn coordinates flag after a startup, using a score to see if they were online before a crash/restart... I'm not a datapack wizzard though.
Please check if this is still an issue for you in 1.16 Release Candidate 1 or later.