PocketMine-MP 5.11.2 git-b744e09352a714d89220719ab6948a010ac636fc
pocketmine\world\ChunkListener Interface Reference
+ Inheritance diagram for pocketmine\world\ChunkListener:
+ Collaboration diagram for pocketmine\world\ChunkListener:

Public Member Functions

 onBlockChanged (Vector3 $block)
 
 onChunkChanged (int $chunkX, int $chunkZ, Chunk $chunk)
 
 onChunkLoaded (int $chunkX, int $chunkZ, Chunk $chunk)
 
 onChunkPopulated (int $chunkX, int $chunkZ, Chunk $chunk)
 
 onChunkUnloaded (int $chunkX, int $chunkZ, Chunk $chunk)
 

Detailed Description

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.

See also
World::registerChunkListener()
World::unregisterChunkListener()

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.

Definition at line 41 of file ChunkListener.php.

Member Function Documentation

◆ onBlockChanged()

pocketmine\world\ChunkListener::onBlockChanged ( Vector3  $block)

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

Implemented in pocketmine\network\mcpe\cache\ChunkCache.

◆ onChunkChanged()

pocketmine\world\ChunkListener::onChunkChanged ( int  $chunkX,
int  $chunkZ,
Chunk  $chunk 
)

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

Implemented in pocketmine\network\mcpe\cache\ChunkCache, and pocketmine\player\Player.

◆ onChunkLoaded()

pocketmine\world\ChunkListener::onChunkLoaded ( int  $chunkX,
int  $chunkZ,
Chunk  $chunk 
)

This method will be called when a registered chunk is loaded

◆ onChunkPopulated()

pocketmine\world\ChunkListener::onChunkPopulated ( int  $chunkX,
int  $chunkZ,
Chunk  $chunk 
)

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

◆ onChunkUnloaded()

pocketmine\world\ChunkListener::onChunkUnloaded ( int  $chunkX,
int  $chunkZ,
Chunk  $chunk 
)

This method will be called when a registered chunk is unloaded

Implemented in pocketmine\network\mcpe\cache\ChunkCache, and pocketmine\player\Player.


The documentation for this interface was generated from the following file: