Data Types

The scripting engine uses Lua tables with specific entries to communicate information through function calls. This section defines the table structures to be used in scripts.

EntityEventDetails

class EntityEventDetails

Event details type containing a single entity ID.

EntityId: integer

The entity ID related to the event.

GridPosition

class GridPosition

Integer-valued 3D vector type.

X: integer

The X value of the vector.

Y: integer

The Y value of the vector.

Z: integer

The Z value of the vector.

Kinematics

class Kinematics

Describes the position and velocity of an entity.

Position: Vector3

Entity position.

Velocity: Vector3

Entity velocity.

PointLight

class PointLight

Specifies a point light source attached to an entity.

Radius: number

Radius of the light source as a multiple of the block size.

Intensity: number

Intensity of the light source. Larger is brighter.

Color: integer

RGB-packed color of the light source.

PositionOffset: Vector3

Offset of the light source relative to the entity position, specified as a percentage of the sprite size. For example, an offset of (0.5, 0.5, 0.0) positions the light source in the center of the entity’s XY plane.

Vector3

class Vector3

3D vector type.

X: number

The X value of the vector.

Y: number

The Y value of the vector.

Z: number

The Z value of the vector.