Lewati ke konten utama

Interaksi tile

client:hit(point)

FieldType
Signature(self: Client, point: Vec2i) → string?
Returnsstring?nil kalau sukses
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 kalau sukses
Common errorsErrors.NOT_IN_WORLD, Errors.CANCELLED, Errors.DISCONNECTED
Asyncyes

invType ngikut InventoryItemType (default 0 = block). Kalau invType == InventoryItemType.seed, panggilan dirutekan ke paket yang sama dengan plant().

client:plant(point, blockType)

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

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

client:hitEnemy(x, y, aiId)

FieldType
Signature(self: Client, x: number, y: number, aiId: number) → string?
Returnsstring?nil kalau sukses
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)