Wizards of Lua

The Art of Spell Crafting


ChunkEvent

The ChunkEvent is the common base class of ChunkLoadEvent and ChunkUnloadEvent.

Please note that instances of this event could occur asynchronously to the game loop. Hence, if you use an event interceptor to handle them, make sure that your code is thread safe.

The ChunkEvent class is a subtype of the Event class and inherits all its properties and functions.

Here is an overview of the ChunkEvent properties:

Property Type read / write
chunkX number (int) r
chunkZ number (int) r
world World r

Properties

Below you find short descriptions about each of the properties and some examples about how to use them in your spells.


chunkX : number (int)

This is the x-component of the chunk coordinate.


chunkZ : number (int)

This is the z-component of the chunk coordinate.


world : World

This is the world where this event did occur.