[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / [entity/data/live](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/live/index.md) / EntityRuntimes

# Class: EntityRuntimes

Defined in: [packages/prismarine/src/entity/data/live.ts:1631](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/live.ts#L1631)

The data-driven entity runtimes of a server, one per world: each dimension of each level.

Held by the server rather than by either end: the content world adapter
opens one while it assembles a world's groups, and that `World` looks it up
by its dimension and level to tick it. Keyed by both, as `worldKeyOf`
says why.

## Constructors

### Constructor

> **new EntityRuntimes**(): `EntityRuntimes`

#### Returns

`EntityRuntimes`

## Properties

### players

> `readonly` **players**: [`StorePlayers`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/storePlayers/classes/StorePlayers.md)

Defined in: [packages/prismarine/src/entity/data/live.ts:1635](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/live.ts#L1635)

The server's store players, which every world's actors read.

## Methods

### at()

> **at**(`dimension`, `level?`): [`LiveEntityRuntime`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/live/classes/LiveEntityRuntime.md) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/live.ts:1658](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/live.ts#L1658)

The runtime of one world, or undefined when nothing opened one.

#### Parameters

##### dimension

`string`

The namespaced dimension identifier.

##### level?

`string`

The level's name, or undefined for the default level.

#### Returns

[`LiveEntityRuntime`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/live/classes/LiveEntityRuntime.md) \| `undefined`

***

### close()

> **close**(`dimension`, `level?`): `void`

Defined in: [packages/prismarine/src/entity/data/live.ts:1676](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/live.ts#L1676)

Forgets one world's runtime, which is what closing it does.

#### Parameters

##### dimension

`string`

The namespaced dimension identifier.

##### level?

`string`

The level's name, or undefined for the default level.

#### Returns

`void`

***

### closeAll()

> **closeAll**(): `void`

Defined in: [packages/prismarine/src/entity/data/live.ts:1683](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/live.ts#L1683)

Forgets every runtime, which is what a server shutdown does once the worlds are down.

#### Returns

`void`

***

### goalWorldFor()

> **goalWorldFor**(`instance`): [`GoalWorld`](https://jsprismarine.dev/api/@jsprismarine/entity-goals/index.md#goalworld) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/live.ts:1663](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/live.ts#L1663)

Resolves the goal world from whichever world owns this instance.

#### Parameters

##### instance

[`EntityInstance`](https://jsprismarine.dev/api/@jsprismarine/entities/classes/EntityInstance.md)

#### Returns

[`GoalWorld`](https://jsprismarine.dev/api/@jsprismarine/entity-goals/index.md#goalworld) \| `undefined`

***

### open()

> **open**(`options`): [`LiveEntityRuntime`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/live/classes/LiveEntityRuntime.md)

Defined in: [packages/prismarine/src/entity/data/live.ts:1643](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/live.ts#L1643)

The runtime for one world, built on first ask and kept.

#### Parameters

##### options

[`LiveEntityOptions`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/live/index.md#liveentityoptions)

#### Returns

[`LiveEntityRuntime`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/live/classes/LiveEntityRuntime.md)

The existing runtime when the world already has one, so an
  adapter rebuilt for the same world drives the same entities.
