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

# entity/data/EntityStore

## Classes

- [EntityStore](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/EntityStore/classes/EntityStore.md)

## Interfaces

### EntityStoreCounts

Defined in: [packages/prismarine/src/entity/data/EntityStore.ts:74](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityStore.ts#L74)

What the store reports about itself, by count.

#### Properties

##### kept

> `readonly` **kept**: `number`

Defined in: [packages/prismarine/src/entity/data/EntityStore.ts:83](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityStore.ts#L83)

Units that threw and kept their writes, because a chunk entered inside them.

##### reverted

> `readonly` **reverted**: `number`

Defined in: [packages/prismarine/src/entity/data/EntityStore.ts:81](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityStore.ts#L81)

Units that threw and were reverted.

##### unlogged

> `readonly` **unlogged**: `number`

Defined in: [packages/prismarine/src/entity/data/EntityStore.ts:79](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityStore.ts#L79)

Entries the log could not hold because no tick was open, such as a chunk between ticks.
State entries and the occurrences replication sends are held for the next tick instead.

## Type Aliases

### InverseWriter

> **InverseWriter** = (`inverse`) => `boolean`

Defined in: [packages/prismarine/src/entity/data/EntityStore.ts:66](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityStore.ts#L66)

Writes one inverse entry back to the state it describes, without logging it.

#### Parameters

##### inverse

[`StateEntry`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/changelog/ChangeEntry/index.md#stateentry)

#### Returns

`boolean`

Whether the writer knew the entity the entry addresses. The store asks each writer in
  the order it was registered.

***

### UnitOutcome

> **UnitOutcome** = \{ `failed`: `false`; \} \| \{ `error`: `unknown`; `failed`: `true`; \}

Defined in: [packages/prismarine/src/entity/data/EntityStore.ts:69](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityStore.ts#L69)

How a unit of work ended.

## Variables

### ENTITY\_FAILURE\_LIMIT

> `const` **ENTITY\_FAILURE\_LIMIT**: `3` = `3`

Defined in: [packages/prismarine/src/entity/data/EntityStore.ts:58](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/EntityStore.ts#L58)

How many updates in a row an entity may fail before the store removes it. One failure can
be a bad neighbor or a bad block; a run of them is the entity itself.
