Skip to content

Class: BlockEntities ​

Defined in: packages/minerender/src/assets/BlockEntities.ts:42

Constructors ​

Constructor ​

ts
new BlockEntities(): BlockEntities;

Returns ​

BlockEntities

Methods ​

entry() ​

ts
static entry(index, block): Maybe<BlockEntityEntry>;

Defined in: packages/minerender/src/assets/BlockEntities.ts:65

The index entry of a block ID such as minecraft:chest.

Parameters ​

ParameterType
indexBlockEntityIndex
blockstring

Returns ​

Maybe<BlockEntityEntry>


getIndex() ​

ts
static getIndex(root?): Promise<BlockEntityIndex>;

Defined in: packages/minerender/src/assets/BlockEntities.ts:49

Loads the block index of a version. Versions and sources without one yield an empty index, and so does a failed load: the index is optional, and blocks must not retry or fail with it one by one. The empty result is cached like any other; Caching.clear() or AssetLoader.setVersion() forces a new attempt.

Parameters ​

ParameterType
root?string

Returns ​

Promise<BlockEntityIndex>


matrix() ​

ts
static matrix(resolved, matrix?): Matrix4;

Defined in: packages/minerender/src/assets/BlockEntities.ts:89

Placement in block space (0..16 per axis), applied on top of the model's own transform.

Parameters ​

ParameterType
resolvedResolvedBlockEntity
matrixMatrix4

Returns ​

Matrix4


resolve() ​

ts
static resolve(
   index, 
   block, 
   state?
): Maybe<ResolvedBlockEntity>;

Defined in: packages/minerender/src/assets/BlockEntities.ts:71

Selects the parts and placement for a block ID such as minecraft:chest; undefined when nothing is drawn.

Parameters ​

ParameterType
indexBlockEntityIndex
blockstring
stateBlockStateProperties

Returns ​

Maybe<ResolvedBlockEntity>