Home > server > EntityManager
Manages entities in a world.
Signature:
export default class EntityManager The EntityManager is created internally as a singleton for each World instance in a game server. It allows retrieval of all entities, player entities, and more.
The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the EntityManager class.
// Get all entities in the world
const entityManager = world.entityManager;
const entities = entityManager.getAllEntities();|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
number |
The number of spawned entities in the world. | |
|
|
The world the entity manager is for. |
|
Method |
Modifiers |
Description |
|---|---|---|
|
Gets all spawned entities in the world. | ||
|
Gets all spawned player entities in the world. | ||
|
Gets all spawned entities in the world with a specific tag. | ||
|
Gets all spawned entities in the world with a tag that includes a specific substring. | ||
|
Gets a spawned entity in the world by its id. | ||
|
Gets all child entities of an entity. | ||
|
Gets all spawned entities in the world assigned to the provided player. |