Skip to content

WorldAgeWorldData 5.47.0 ​

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

Extends WorldData

World data which stores the age of the world: the number of ticks it has run since it was created, which unlike the world time is not changed by /time and keeps going while the daylight cycle is off (Bedrock level.dat "currentTick"). Kept out of WorldData so that world providers written by plugins against the original interface keep working; for worlds whose data doesn't implement it, the age starts from the world time when the world is loaded.

Methods ​

getWorldAge() ​

php
public function getWorldAge() : ?int

Returns the stored age of the world in ticks, or null if the world has none yet (worlds saved by older versions).

setWorldAge() ​

php
public function setWorldAge(int $ticks) : void

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