When almost all players on a server/OpenToLan-world are asleep and the last player is set to spectator mode the all-players-sleeping flag is not updated, causing it to stay night.
What I expected to happen was...:
When all players that are not spectators are asleep, the night should get skipped.
What actually happened was...:
It stayed night after the last player was set to spectator mode.
Steps to Reproduce:
1. Get on a server with one other player.
2. /gamemode 1 @a
3. /time set night
4. Player 1 lies down in a bed.
5. Player 2 sets his gamemode to spectator mode. (/gamemode 3)
6. The night won't get skipped.
Linked issues
Comments 8
Related, yes. Dupe, no. Let me explain:
MC-47080: One player in survival mode, one player in spectator mode. Survival player enters bed, but night doesn't skip because not all players are in bed. This is fixed, but the fix is incomplete. This is what MC-88095 is about: The scenario I just described works fine now, but this one still doesn't: Both players are in survival, one enters a bed. Then the other switches to spectator mode. All relevant players are in bed, but the night doesn't skip because the trigger for skipping the night is only done when a player enters a bed.
Ah, I see. "the trigger for skipping the Night is only done when a player enters a bed." isn't true though. If one player is in a bed and the other logs out, then it will skip.
Also, this is fixed now, right?
I actually only fixed the bug when a player switches to spectator while all the players are in bed.
I will test the case when the last player is disconnecting while all the other players are in bed.
KingSupernova said that was fixed a while ago/never a bug in the first place. And I just tested, it's not an issue.
Logging out to skip with one person in a bed has worked for a long time. It often used on servers when people don't have beds on hand.
Dupe of MC-47080?