Documentation

ChunkListener

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.

Tags
see
World::registerChunkListener()
see
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.

Table of Contents

onBlockChanged()  : void
This method will be called when a block changes in a registered chunk
onChunkChanged()  : void
This method will be called when a Chunk is replaced by a new one
onChunkLoaded()  : void
This method will be called when a registered chunk is loaded
onChunkPopulated()  : void
This method will be called when a registered chunk is populated Usually it'll be sent with another call to onChunkChanged()
onChunkUnloaded()  : void
This method will be called when a registered chunk is unloaded

Methods

onBlockChanged()

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

public onBlockChanged(Vector3 $block) : void
Parameters
$block : Vector3
Return values
void

onChunkChanged()

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

public onChunkChanged(int $chunkX, int $chunkZ, Chunk $chunk) : void
Parameters
$chunkX : int
$chunkZ : int
$chunk : Chunk
Return values
void

onChunkLoaded()

This method will be called when a registered chunk is loaded

public onChunkLoaded(int $chunkX, int $chunkZ, Chunk $chunk) : void
Parameters
$chunkX : int
$chunkZ : int
$chunk : Chunk
Return values
void

onChunkPopulated()

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

public onChunkPopulated(int $chunkX, int $chunkZ, Chunk $chunk) : void
Parameters
$chunkX : int
$chunkZ : int
$chunk : Chunk
Return values
void

onChunkUnloaded()

This method will be called when a registered chunk is unloaded

public onChunkUnloaded(int $chunkX, int $chunkZ, Chunk $chunk) : void
Parameters
$chunkX : int
$chunkZ : int
$chunk : Chunk
Return values
void

Search results