Skip to content

WorldGameRuleChangeEvent 5.47.0 ​

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

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|int

getOldValue() ​

php
public function getOldValue() : bool|int

getRule() ​

php
public function getRule() : string

Name of the rule, see \pocketmine\world\GameRules.

setNewValue() ​

php
public function setNewValue(bool|int $newValue) : void

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.