hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
56 lines (27 loc) • 794 B
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [EntityManager](./server.entitymanager.md) > [getEntity](./server.entitymanager.getentity.md)
## EntityManager.getEntity() method
Gets a spawned entity in the world by its id.
**Signature:**
```typescript
getEntity<T extends Entity>(id: number): T | undefined;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
id
</td><td>
number
</td><td>
The id of the entity to get.
</td></tr>
</tbody></table>
**Returns:**
T \| undefined
The spawned entity with the provided id, or undefined if no entity is found.