Skip to content

WeatherChangeEvent 5.46.0 ​

final class · pocketmine\event\world\WeatherChangeEvent · source

Extends WorldEvent
Implements Cancellable

Called when the weather of a world is about to change (natural cycle, /weather, sleeping through the night or a plugin). Cancelling it keeps the current weather; the natural cycle then waits for its next change.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\World $world, bool $wasRaining, bool $wasThundering, bool $raining, bool $thundering)

isRaining() ​

php
public function isRaining() : bool

Whether it will be raining (or snowing) after the change.

isThundering() ​

php
public function isThundering() : bool

Whether there will be a thunderstorm after the change (always raining too).

wasRaining() ​

php
public function wasRaining() : bool

wasThundering() ​

php
public function wasThundering() : bool

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.