Skip to main content

Tile interaction

client:hit(point)

FieldType
Signature(self: Client, point: Vec2i) → string?
Returnsstring?nil on success
Common errorsErrors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED
Asyncyes

client:place(point, blockType, invType?)

FieldType
Signature(self: Client, point: Vec2i, blockType: number, invType: number?) → string?
Returnsstring?nil on success
Common errorsErrors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED
Asyncyes

invType mirrors InventoryItemType (default 0 = block). When invType == InventoryItemType.seed the call routes through the same packet as plant().

client:plant(point, blockType)

FieldType
Signature(self: Client, point: Vec2i, blockType: number) → string?
Returnsstring?nil on success
Common errorsErrors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED
Asyncyes

Shorthand for place(point, blockType, InventoryItemType.seed).

client:hitEnemy(x, y, aiId)

FieldType
Signature(self: Client, x: number, y: number, aiId: number) → string?
Returnsstring?nil on success
Common errorsErrors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED
Asyncyes
client:hit(Vector2i.new(5, 3))
client:place(Vector2i.new(5, 3), blockType, inventoryType)
client:plant(Vector2i.new(5, 3), blockType)
client:hitEnemy(x, y, aiId)