<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [server](./server.md) &gt; [EntityManager](./server.entitymanager.md) &gt; [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.

