Skip to content

Class: Entities ​

Defined in: packages/minerender/src/assets/Entities.ts:16

Loads entity and block-entity geometry, texture selections, and animation clips from the dataset.

Constructors ​

Constructor ​

ts
new Entities(): Entities;

Returns ​

Entities

Methods ​

getAnimations() ​

ts
static getAnimations(modelKey): Promise<Maybe<Record<string, EntityAnimation>>>;

Defined in: packages/minerender/src/assets/Entities.ts:130

Native and sampled vanilla clips by name, or undefined when the model or selected version has none.

Parameters ​

ParameterType
modelKeyBasicAssetKey

Returns ​

Promise<Maybe<Record<string, EntityAnimation>>>


getBlock() ​

ts
static getBlock(
   modelKey, 
   textureKey?, 
   options?
): Promise<Maybe<EntityModel>>;

Defined in: packages/minerender/src/assets/Entities.ts:171

Parameters ​

ParameterType
modelKeyBasicAssetKey
textureKey?BasicAssetKey
options?EntityModelOptions

Returns ​

Promise<Maybe<EntityModel>>

Deprecated ​

Use getEntity(); block entities share the entity dataset.


getBlockList() ​

ts
static getBlockList(): Promise<string[]>;

Defined in: packages/minerender/src/assets/Entities.ts:166

Returns ​

Promise<string[]>

Deprecated ​

Use getEntityList(); block entities share the entity dataset.


getDatasetRoot() ​

ts
static getDatasetRoot(root?): Promise<Maybe<string>>;

Defined in: packages/minerender/src/assets/Entities.ts:23

Resolves root (default: the active version). Uses the exact dataset when published or when the version is not a release; otherwise selects the nearest published release, like MineRenderData.resolve. Textures keep the requested root.

Parameters ​

ParameterType
root?string

Returns ​

Promise<Maybe<string>>


getEntity() ​

ts
static getEntity(
   modelKey, 
   textureKey?, 
   options?
): Promise<Maybe<EntityModel>>;

Defined in: packages/minerender/src/assets/Entities.ts:85

Loads the layers and textures to pass to MineRenderScene.addEntity. By default, selects main, unconditional passes, and passes enabled by options.when.

Parameters ​

ParameterTypeDescription
modelKeyBasicAssetKeyDataset model, such as new BasicAssetKey("minecraft", "zombie").
textureKey?BasicAssetKeyTexture override for the first selected layer.
options?EntityModelOptionsLayer selection, conditional passes, and per-layer texture overrides.

Returns ​

Promise<Maybe<EntityModel>>

The selected model, or undefined when its dataset file is missing.


getEntityList() ​

ts
static getEntityList(): Promise<string[]>;

Defined in: packages/minerender/src/assets/Entities.ts:45

Lists model paths in the minecraft namespace, including subdirectories and excluding .json.

Returns ​

Promise<string[]>


getLayerList() ​

ts
static getLayerList(modelKey): Promise<string[]>;

Defined in: packages/minerender/src/assets/Entities.ts:67

Returns selectable geometry-layer names, or an empty list when the model is missing.

Parameters ​

ParameterType
modelKeyBasicAssetKey

Returns ​

Promise<string[]>


getPassList() ​

ts
static getPassList(modelKey): Promise<EntityModelPass[]>;

Defined in: packages/minerender/src/assets/Entities.ts:72

The dataset's extra draws on top of main; their when labels are the states EntityModelOptions.when can enable.

Parameters ​

ParameterType
modelKeyBasicAssetKey

Returns ​

Promise<EntityModelPass[]>


resolveTexture() ​

ts
static resolveTexture(modelKey): Promise<Maybe<AssetKey>>;

Defined in: packages/minerender/src/assets/Entities.ts:138

Finds a fallback texture using the model path, its directory, and vanilla variant data.

Parameters ​

ParameterType
modelKeyBasicAssetKey

Returns ​

Promise<Maybe<AssetKey>>