[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / world/chunk/BlockStorage

# world/chunk/BlockStorage

## Classes

- [BlockStorage](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/chunk/BlockStorage/classes/BlockStorage.md)
- [BlockWriteCounter](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/chunk/BlockStorage/classes/BlockWriteCounter.md)

## Interfaces

### BlockStorageData

Defined in: [packages/prismarine/src/world/chunk/BlockStorage.ts:11](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/chunk/BlockStorage.ts#L11)

The contents a block storage starts from: palette indices and the palette they index.

#### Properties

##### \[OWNED\_INDICES\]?

> `optional` **\[OWNED\_INDICES\]?**: `true`

Defined in: [packages/prismarine/src/world/chunk/BlockStorage.ts:15](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/chunk/BlockStorage.ts#L15)

##### blocks?

> `optional` **blocks?**: `ArrayLike`\<`number`\>

Defined in: [packages/prismarine/src/world/chunk/BlockStorage.ts:13](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/chunk/BlockStorage.ts#L13)

One palette index per block, in XZY order. Copied, so the caller may reuse its buffer.

##### palette?

> `optional` **palette?**: `number`[]

Defined in: [packages/prismarine/src/world/chunk/BlockStorage.ts:14](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/chunk/BlockStorage.ts#L14)

## Type Aliases

### ReadonlyBlockStorage

> **ReadonlyBlockStorage** = `Pick`\<[`BlockStorage`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/chunk/BlockStorage/classes/BlockStorage.md), `"getBlock"` \| `"getRevision"` \| `"getRuntimeId"` \| `"getIndexStorageByteLength"` \| `"getRetainedIndexStorageByteLength"` \| `"getPalette"` \| `"getPaletteIndexAt"` \| `"getPaletteIndexAtIndex"` \| `"getPackedIndexWords"` \| `"networkSerialize"` \| `"isEmpty"`\>

Defined in: [packages/prismarine/src/world/chunk/BlockStorage.ts:129](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/world/chunk/BlockStorage.ts#L129)

A block storage that can be read and not written.

What a chunk hands out once it is in a world: a write has to go through the chunk, so the save
cut hears of it before it lands (ADR 0018). A list of what may be read rather than of what may
not, so a mutator added to [BlockStorage](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/chunk/BlockStorage/classes/BlockStorage.md) later stays out of it.
