Thunder can occur in the game only when the rain and thunder states both happen to be 'on' at the same time.When thunder is turned on, the thunder counter is reset to 3,600-15,999 ticks (3-13 minutes), and when thunder is turned off the counter rests to 12,000-179,999 ticks (0.5-7.5 days). Like the rain counter, the thunder counter also toggles thunder on and off when it reaches zero, but clear weather overrides the 'on' state.When the rain is turned on, the counter is reset to a value between 12,000-23,999 ticks (0.5-1 game days), and when the rain is turned off the counter is reset to a value of 12,000-179,999 ticks (0.5-7.5 game days). The rain counter counts down to zero, and each time it reaches zero, the rain is toggled on or off.This counter is used only when the '/weather clear' command is issued, setting the counter to a value given by the player or 5 minutes (see Commands/weather)
The exact type of precipitation during a thunderstorm varies depending on the temperature of the current biome, as well as the current altitude. Thunderstorms are an uncommon temporary, global occurrence that can happen randomly at any time, within the Overworld.