# 今の天気を調べる(gameplay.weatherQuery) > 今の天気を調べて、その値を返すブロックです。 - カテゴリ:ゲームプレイ(gameplay) - ブロック:現在の天気 - URL:https://makecode.minecraft-okinawa.com/reference/gameplay/current-weather/ - Pythonでの名前:gameplay.weather_query - 公式データ取得日:2026-11-13 - 動作確認:確認待ち ## JavaScript ```javascript gameplay.weatherQuery() ``` ## Python ```python gameplay.weather_query() ``` ## 使用例 ### Check the weather and have your player say a forecast: ```javascript 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!") } }); ``` ```python def on_on_chat(): if gameplay.weather_query() == CLEAR: player.say("It's sunny!") elif gameplay.weather_query() == RAIN: player.say("It's raining!") elif gameplay.weather_query() == THUNDER: player.say("It's a thunderstorm!") player.on_chat("forecast", on_on_chat) ``` ## 出典 - [MakeCode for Minecraft 公式リファレンス(gameplay.weatherQuery)](https://minecraft.makecode.com/reference/gameplay/current-weather) 執筆:鈴木孝昌(現役プロジェクトマネージャー/マイクラカップ指導者)/運営:沖縄マイクラ部 プログラミングスクール「クロスウェーブ」(https://minecraft-okinawa.com/)