Skip to content

GameRulesWorldData 5.47.0 ​

interface · pocketmine\world\format\io\GameRulesWorldData · source

Extends WorldData

World data which stores game rules (see \pocketmine\world\GameRules). Kept out of WorldData so that world providers written by plugins against the original interface keep working; worlds whose data doesn't implement it keep their rules in memory only (defaults on every load).

Methods ​

getGameRule() ​

php
public function getGameRule(string $name) : bool|int|null

Returns the stored value of a game rule, or null if the world data has none (the default applies).

setGameRule() ​

php
public function setGameRule(string $name, bool|int $value) : void

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