UNPKG

hytopia

Version:

The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.

70 lines (33 loc) 1.02 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [server](./server.md) &gt; [ChunkLattice](./server.chunklattice.md) &gt; [setBlock](./server.chunklattice.setblock.md) ## ChunkLattice.setBlock() method Set the block at a global coordinate by block type id, automatically creating a chunk if it doesn't exist. Use block type id 0 for air. **Signature:** ```typescript setBlock(globalCoordinate: Vector3Like, blockTypeId: number): void; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> globalCoordinate </td><td> [Vector3Like](./server.vector3like.md) </td><td> The global coordinate of the block to set. </td></tr> <tr><td> blockTypeId </td><td> number </td><td> The block type id to set. Use 0 to remove the block and replace with air. </td></tr> </tbody></table> **Returns:** void