UNPKG

hytopia

Version:

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

64 lines (31 loc) 1.08 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; [getOrCreateChunk](./server.chunklattice.getorcreatechunk.md) ## ChunkLattice.getOrCreateChunk() method Gets the chunk for a given global coordinate, creating it if it doesn't exist. **Signature:** ```typescript getOrCreateChunk(globalCoordinate: Vector3Like): Chunk; ``` ## 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 chunk to get. </td></tr> </tbody></table> **Returns:** [Chunk](./server.chunk.md) The chunk at the given global coordinate (created if needed). \*\*Side effects:\*\* May create and register a new chunk. \*\*Category:\*\* Blocks ## Remarks Creates a new chunk and emits `ChunkLatticeEvent.ADD_CHUNK` if needed.