UNPKG

hytopia

Version:

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

63 lines (30 loc) 1.18 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [server](./server.md) &gt; [Entity](./server.entity.md) &gt; [(constructor)](./server.entity._constructor_.md) ## Entity.(constructor) Creates a new Entity instance. Use for: defining a new entity before spawning it into a world. Do NOT use for: player-controlled avatars (use `PlayerEntity` or `DefaultPlayerEntity`<!-- -->). **Signature:** ```typescript constructor(options: EntityOptions); ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> options </td><td> [EntityOptions](./server.entityoptions.md) </td><td> The options for the entity. \*\*Requires:\*\* If `parent` is provided, it must already be spawned. \*\*Side effects:\*\* May attach the provided controller. \*\*Category:\*\* Entities </td></tr> </tbody></table> ## Remarks Exactly one of `blockTextureUri` or `modelUri` must be provided. If `controller` is provided, `controller.attach(this)` is called during construction (before spawn).