mojira.dev
MCPE-238521

WeatherChange event does not fire when weather is changed by sleeping in a bed

The world.afterEvents.weatherChange event does not trigger when the weather changes due to a player sleeping in a bed.

It only triggers when the weather is changed through commands or natural in-game weather progression.

This creates inconsistency in systems that rely on weather tracking through the Script API, since sleeping still changes the weather state in the world, but does not fire the expected event.

A noticeable behavior difference can be observed:

  • Weather change via command → event is triggered correctly and message appears in chat

  • Weather change via sleeping → no event is triggered and no message appears

This can break systems that depend on real-time weather tracking, such as custom storms, fog systems, and particle-based weather effects.

Steps to reproduce the issue:

  1. Create a script using:

world.afterEvents.weatherChange.subscribe((eventData) => {
world.sendMessage(`Weather changed from ${eventData.previousWeather} to ${eventData.newWeather}`);
});

2. Start a world with cheats enabled

3. Set weather to thunder using `/weather thunder`

4. Sleep in a bed to skip the night and clear weather

5. Observe that no message or event is triggered

Expected result:

The `weatherChange` event should be triggered regardless of how the weather changes (commands, natural transitions, or sleeping).

Actual result:

The event is only triggered when weather changes via commands or natural weather cycle. Sleeping does not trigger the event.

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media]

Joaololpvp

(Unassigned)

Unconfirmed

Android

26.30.26 Preview, 26.30.25 Preview, 26.13

Retrieved