Skip to content

feat: implement weather system#6870

Open
GroXzaLYs wants to merge 17 commits intopmmp:minor-nextfrom
GroXzaLYs:feature/weather-system
Open

feat: implement weather system#6870
GroXzaLYs wants to merge 17 commits intopmmp:minor-nextfrom
GroXzaLYs:feature/weather-system

Conversation

@GroXzaLYs
Copy link

@GroXzaLYs GroXzaLYs commented Oct 28, 2025

Adds a basic dynamic weather system with automatic transitions between clear weather, rain, and thunderstorms.

Rain, thunder, and lightning are handled server-side and synchronized for all players.


Related issues & PRs


Changes

  • Added Lightning weather entity
  • Added weather-related methods to World
  • Added /weather command

Compatibility

No breaking changes.
Worlds without weather support are unaffected.


Testing

Manual testing:

  • /weather rain and /weather thunder work correctly
  • Thunder sounds and lightning visuals are synced
  • No crashes or performance issues observed
Minecraft_2025-10-28-21-49-18.mp4

@GroXzaLYs GroXzaLYs requested a review from a team as a code owner October 28, 2025 10:50
@GroXzaLYs GroXzaLYs changed the base branch from stable to minor-next October 28, 2025 12:03
@dktapps dktapps added Category: API Related to the plugin API Category: Gameplay Related to Minecraft gameplay experience Status: Waiting on Author Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Oct 28, 2025
@GroXzaLYs GroXzaLYs requested a review from dktapps October 30, 2025 04:00
Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I don't know what editor you're using but it's made an enormous mess of your indentation. Indents should use tabs.

@dktapps
Copy link
Member

dktapps commented Oct 30, 2025

Overall this is looking better since the last time I reviewed, but there's still some work left to do. Thanks for sticking with it 🙂

Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly OK now, code-wise.

I think my main sticking points remaining are:

  • There doesn't appear to be any way to disable the system, short of just setting the weather to clear for a very large duration. People aren't going to want it to rain in their lobbies.
  • I don't like that we're constrained to clear/rainy/thunder.
    • setRainLevel and setThunderLevel will not update the WeatherType, so that means plugins can make the /weather command return wrong results anyway.
    • Instead of generally constraining it by the type, it would be better to have the /weather command dynamically decide the weather type based on the rain and thunder amount (e.g. rain=0 + thunder=0 = clear, rain>0 + thunder=0 = rainy, thunder > 0 = thunder (whether or not it's raining)).

@GroXzaLYs GroXzaLYs force-pushed the feature/weather-system branch from a75eeea to 73aff4e Compare January 1, 2026 01:30
@kostamax27
Copy link
Contributor

//TODO: weather needs to be synced here (when implemented)

$levelSettings->rainLevel = 0; //TODO: implement these properly
$levelSettings->lightningLevel = 0;

@kostamax27
Copy link
Contributor

@remminiscent
Copy link
Contributor

It seems like snow isn’t acknowledged here either.

@dktapps
Copy link
Member

dktapps commented Jan 2, 2026

Ok, I didn't want to come off as a jerk and say this so bluntly, but this has gone on long enough that the notification spam from here is really getting on my nerves. I'm on the verge of muting the PR.

There are very basic errors in each commit that could be easily addressed by using the proper tools locally instead of spamming commits. Spamming commits chasing after CI failures is unproductive and it's also annoying for everyone getting notifications.

  • Use an IDE like PhpStorm for writing and refactoring code. Notepads and generic text editors aren't enough without other tools
  • Run vendor/bin/phpstan locally before you commit, it'll catch the obvious errors
  • Run vendor/bin/phpunit tests/phpunit to run the unit tests
  • php-cs-fixer can help with some (not all) formatting problems

@GroXzaLYs
Copy link
Author

Got it, sorry about all the commit spam. I’ll run the checks on my end and won’t push small changes based on CI results anymore. Thanks for bringing this up!

@GroXzaLYs GroXzaLYs requested a review from kostamax27 January 3, 2026 02:40
@GroXzaLYs GroXzaLYs requested a review from kostamax27 January 10, 2026 01:51
}

protected function getInitialDragMultiplier() : float{
return 0.02;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?


protected function initEntity(CompoundTag $nbt) : void{
parent::initEntity($nbt);
$this->setNameTagVisible(false);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

@kostamax27
Copy link
Contributor

I no longer know how this can be expanded...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Category: API Related to the plugin API Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

6 participants