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

# Class: EntityFactsLookup

Defined in: [packages/prismarine/src/entity/data/facts.ts:130](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/facts.ts#L130)

Reads the facts of every entity type in a registry, once.

Deliberately a lookup over a registry rather than a free function over a
type: the facts are cached, and a content reload replaces the whole registry
and so the whole lookup, which is the rule the content root sets for
anything keyed by a positional id.

What a type declares in its base components, which is what a caller holding
no entity can know. Wrap the answer in [liveFactsOf](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/facts/index.md#livefactsof) wherever there is
an entity to read instead.

## Constructors

### Constructor

> **new EntityFactsLookup**(`registry`): `EntityFactsLookup`

Defined in: [packages/prismarine/src/entity/data/facts.ts:133](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/facts.ts#L133)

#### Parameters

##### registry

[`Registry`](https://jsprismarine.dev/api/@jsprismarine/content/classes/Registry.md)\<[`EntityType`](https://jsprismarine.dev/api/@jsprismarine/entities/index.md#entitytype)\>

#### Returns

`EntityFactsLookup`

## Methods

### get()

> **get**(`identifier`): [`EntityFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/facts/index.md#entityfacts) \| `undefined`

Defined in: [packages/prismarine/src/entity/data/facts.ts:145](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/facts.ts#L145)

The facts of one type, or undefined when the content carries no such
entity. Nothing is guessed: a caller that gets undefined knows the pack
stack never declared the entity.

#### Parameters

##### identifier

`string`

#### Returns

[`EntityFacts`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/facts/index.md#entityfacts) \| `undefined`

***

### identifiers()

> **identifiers**(): readonly `string`[]

Defined in: [packages/prismarine/src/entity/data/facts.ts:136](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/facts.ts#L136)

The identifiers the registry carries, in registry order.

#### Returns

readonly `string`[]
