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
andthunderTime
values in thelevel.dat
file using for example NBTExplorer or NBT StudioSet 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.
Linked issues
is duplicated by 3
Comments 22
Are you sure? It makes sense that sleeping would cause rain to stop โ the idea is that the player sleeps, and then the rain is gone in the morning. However, sleeping when it's not raining shouldn't reset the timer (in fact, one would think that the timer would get smaller, because "the next morning" is closer to the scheduled rain time.
Has Mojang confirmed that it's intended? It's been in the game for awhile, but it could just be a long-standing oversight that no one has fixed yet.
This appears to be a duplicate ofย MC-3865.
The core problem is sleeping resets the rain counter and usually picks a value longer than 1 day (more than 95% of the time). So if you sleep to skip night every night it almost never reaches the point where rain starts. The exceptions seen usually are because of not skipping a night due to mining, or intentionally not skipping night so you can get monster fights. So it's a bug in the sense of poorly planned game logic, not a mis-programming in the implementation.
The best solution is to make skipping the night not reset the counter unless it's raining, although changing the range of the roll so that it happens before sunset 25 percent of the time would work too.
Maybe this is why it always rains on the Mindcrack server ๐