今の天気を調べる gameplay.weatherQuery

ゲームプレイ公式データ取得日:2026年11月13日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)

いっしょに使うブロック

執筆:鈴木孝昌官公庁のWeb・システム開発を担当する現役プロジェクトマネージャー。マイクラカップ沖縄代表チームを指導(第6回・第7回、第7回TBS賞)。
沖縄マイクラ部で、子どもたちにMakeCodeを教えています。プロフィールと編集方針
Instagramで教室の様子を見る
noteで記事を読む