The bug
When all players are sleeping and then woken up, rain and thunder times are always reset, regardless whether or not it was raining while the players were sleeping.
As a result, if you skip every night, you are very unlikely to ever experience rain or thunder, since the rain time is usually set to a value that is longer than a day (10 minutes).
How to reproduce
- Reset weather
/weather clear 0
- Pause the world (to save it) and inspect the rainTime and thunderTime values in the level.dat file using for example NBTExplorer or NBT Studio
- Set time to night
/time set midnight
- Sleep and wait until you are woken up
- Repeat step 2
→ The values were changed to a random value despite it not raining or thundering
It would be expected for the weather to be reset only if it is currently raining/thundering.
Code analysis
Based on 1.12.2 decompiled using MCP 9.40
The method net.minecraft.world.WorldServer.wakeAllPlayers() always resets thunder and rain time.
- is duplicated by
-
MC-151764 Weather seems to change to thunderstorm every 5 minutes.
- Resolved
-
MC-167256 In Realms, rainy weather and thunder happens doesn't stop. Sleeping will stop it for five minutes, before it restarts. Same with /weather clear.
- Resolved
-
MC-171098 Daily thunderstorms and very dark
- Resolved
- relates to
-
MC-222596 Sleeping through thunderstorms resets time of day
- Open