Sleeping always resets time until rain
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.
2014-07-24, 04:43 AM
2021-11-03, 04:57 PM
2021-11-03, 04:57 PM
38
17