Skip to content

PlayerViewDistanceChangeEvent ​

class · pocketmine\event\player\PlayerViewDistanceChangeEvent · source

Extends PlayerEvent

Called when a player requests a different viewing distance than the current one.

Properties ​

$newDistance ​

php
public int $newDistance

$oldDistance ​

php
public int $oldDistance

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\Player $player, int $oldDistance, int $newDistance)

getNewDistance() ​

php
public function getNewDistance() : int

Returns the new view radius, measured in chunks.

getOldDistance() ​

php
public function getOldDistance() : int

Returns the old view radius, measured in chunks. A value of -1 means that the player has just connected and did not have a view distance before this event.

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