Entity

Entity entity

Fields

Field
Type
Description

string

UUID of the entity. Read-only.

string

Type of the entity. Read-only.

table

Custom lua table which can be used to store any data about the entity.

Chunkloader (Premium Only)

bool

If true, the chunk containing this entity will remain loaded even if no players are present.

bool

If true, when the chunk containing this entity is unloaded, it will not be persisted.

Methods

Method
Parameters
Returns
Description

dx: float dy: float dz: float

None

Move the entity relative to its current position.

x: float y: float z: float

None

Move the entity relative to the origin (teleport).

None

x: float y: float z: float

Get the current position of the entity. Returns individual coordinates x, y, z.

None

None

Delete this entity.

dist: float

Entity[]

Get entities within the specified distance. Within a 3x3 grid of chunks around the entity.

dimension: string x: float y: float z: float

None

Transport this entity to coordinates (x,y,z) in the dimension specified.

The x, y, and z fields are optional and default to 0.

Necessary Methods

Method
Parameters
Return Value
Description

self: Entity

None

A necessary function, to initialise an entity in its default state.

Method
Parameters
Return Value
Description

self: Entity dt: float

None

A necessary function, to process an entity's behaviour each tick.

Method
Parameters
Return Value
Description

self: Entity

msg: table({ Data: table Client: bool )}

None

A necessary function, to receive messages to an entity.

Last updated