import { world } from '@minecraft/server';
import { FSWorldStoredData } from '../constants.js';

world.afterEvents.weatherChange.subscribe((event) => {
    const dimensionId = event.dimension;
    const weather = event.newWeather;
    const identifier = FSWorldStoredData.weather(dimensionId);
    world.setDynamicProperty(identifier, weather);
});
