Skip to content

ChunkListener ​

interface · pocketmine\world\ChunkListener · source

This interface allows you to listen for events occurring on or in specific chunks. This will receive events for any chunks which it is registered to listen to.

WARNING: When you're done with the listener, make sure you unregister it from all chunks it's listening to, otherwise the object will not be destroyed. The listener WILL NOT be unregistered when chunks are unloaded. You need to do this yourself when you're done with a chunk.

Methods ​

onBlockChanged() ​

php
public function onBlockChanged(\pocketmine\math\Vector3 $block) : void

This method will be called when a block changes in a registered chunk

onChunkChanged() ​

php
public function onChunkChanged(int $chunkX, int $chunkZ, \pocketmine\world\format\Chunk $chunk) : void

This method will be called when a Chunk is replaced by a new one

onChunkLoaded() ​

php
public function onChunkLoaded(int $chunkX, int $chunkZ, \pocketmine\world\format\Chunk $chunk) : void

This method will be called when a registered chunk is loaded

onChunkPopulated() ​

php
public function onChunkPopulated(int $chunkX, int $chunkZ, \pocketmine\world\format\Chunk $chunk) : void

This method will be called when a registered chunk is populated Usually it'll be sent with another call to onChunkChanged()

onChunkUnloaded() ​

php
public function onChunkUnloaded(int $chunkX, int $chunkZ, \pocketmine\world\format\Chunk $chunk) : void

This method will be called when a registered chunk is unloaded

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