WorldGameRuleChangeEvent 5.47.0
Extends WorldEvent
Implements Cancellable
Called when a game rule of a world is changed with World::setGameRule() (e.g. /gamerule). The value can be replaced; it must have the rule's type (bool or int).
Methods
__construct()
php
public function __construct(\pocketmine\world\World $world, string $rule, bool|int $oldValue, bool|int $newValue)getNewValue()
php
public function getNewValue() : bool|intgetOldValue()
php
public function getOldValue() : bool|intgetRule()
php
public function getRule() : stringName of the rule, see \pocketmine\world\GameRules.
setNewValue()
php
public function setNewValue(bool|int $newValue) : void