The WeatherChangeAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
import type { WeatherChangeAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.weatherChange.
Example
Section titled “Example”import { world, type WeatherChangeAfterEvent } from '@minecraft/server';
world.afterEvents.weatherChange.subscribe((event: WeatherChangeAfterEvent) => { console.log('weatherChange', event.dimension, event.previousWeather, event.newWeather);});import { world } from '@minecraft/server';
world.afterEvents.weatherChange.subscribe((event) => { console.log('weatherChange', event.dimension, event.previousWeather, event.newWeather);});Properties
Section titled “Properties”dimension
Section titled “dimension”read-only
readonly dimension: string;overworld.
previousWeather
Section titled “previousWeather”read-only
readonly previousWeather: WeatherType;Types
newWeather
Section titled “newWeather”read-only
readonly newWeather: WeatherType;Types
Used by
Section titled “Used by”WorldAfterEvents.weatherChange, WeatherChangeAfterEventSignal.subscribe, WeatherChangeAfterEventSignal.unsubscribe