Skip to content

PositionTrackingDB 5.46.0 ​

final class · pocketmine\world\PositionTrackingDB · source

Server-wide equivalent of the vanilla position tracking database: maps the tracking handles stored in lodestones and lodestone compasses ("trackingHandle") to the lodestone position. Vanilla keeps this per level in LevelDB; PocketMine keeps one table for all worlds in position_tracking.json in the server data folder, so a lodestone compass keeps working across worlds, but handles are not carried over when a world is copied to another server.

Methods ​

__construct() ​

php
public function __construct(?string $path = null)

get() ​

php
public function get(int $handle) : ?array

Returns the position registered for the handle, or null if it is unknown or was removed.

register() ​

php
public function register(string $worldFolderName, int $x, int $y, int $z) : int

Registers the given block position (world folder name and coordinates) and returns its new tracking handle.

remove() ​

php
public function remove(int $handle) : void

wasAssigned() ​

php
public function wasAssigned(int $handle) : bool

Returns whether the handle was assigned at some point (it may have been removed since).

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