Current Weather
Returns the current weather in Minecraft. Either “clear”, “rain”, or “thunder”.
gameplay.weatherQuery()
Snow does not appear in this list because it is actually considered “rain” in Minecraft.
Returns
- a number the current weather in the game
Example
Check the weather and have your player say a forecast:
player.onChat("forecast", function() {
if (gameplay.weatherQuery() === CLEAR) {
player.say("It's sunny!")
}
else if (gameplay.weatherQuery() === RAIN) {
player.say("It's raining!")
}
else if (gameplay.weatherQuery() === THUNDER) {
player.say("It's a thunderstorm!")
}
});