Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

helix / Model

Class: Model โ€‹

Defined in: core/values/model.ts:36

A resource pack model. Model.item(texture) is a flat item sprite; .parent/.texture for others, .raw(json) as an escape hatch. Registered with Datapack.model.

dp.model("web_shooter", Model.item(Texture.vanilla("item/carrot_on_a_stick")))

Constructors โ€‹

Constructor โ€‹

new Model(): Model

Returns โ€‹

Model

Methods โ€‹

ambientOcclusion() โ€‹

ambientOcclusion(on): this

Defined in: core/values/model.ts:92

Turns ambient occlusion on or off (default on).

Parameters โ€‹

on โ€‹

boolean

Returns โ€‹

this


display() โ€‹

display(context, transform): this

Defined in: core/values/model.ts:80

Sets how the model sits in context; other contexts keep the parent's.

Parameters โ€‹

context โ€‹

DisplayContext

transform โ€‹

DisplayTransform

Returns โ€‹

this


element() โ€‹

element(e): this

Defined in: core/values/model.ts:86

Adds a cuboid; a model with elements draws them instead of its parent's.

Parameters โ€‹

e โ€‹

ModelElement

Returns โ€‹

this


guiLight() โ€‹

guiLight(mode): this

Defined in: core/values/model.ts:98

Lights the model in the GUI from the front (flat items) or the side (blocks).

Parameters โ€‹

mode โ€‹

"front" | "side"

Returns โ€‹

this


parent() โ€‹

parent(id): this

Defined in: core/values/model.ts:68

Set the parent model: a registered model's ref, or an id (namespace defaults to minecraft:).

Parameters โ€‹

id โ€‹

string | ModelRef

Returns โ€‹

this


raw() โ€‹

raw(json): this

Defined in: core/values/model.ts:104

Verbatim model JSON escape hatch; wins over the typed fields.

Parameters โ€‹

json โ€‹

Record<string, unknown>

Returns โ€‹

this


texture() โ€‹

texture(slot, texture): this

Defined in: core/values/model.ts:74

Binds a texture slot (e.g. layer0, all) to a texture.

Parameters โ€‹

slot โ€‹

string

texture โ€‹

Texture

Returns โ€‹

this


toJson() โ€‹

toJson(version?): Record<string, unknown>

Defined in: core/values/model.ts:110

The model-file JSON (assets/<ns>/models/item/<name>.json) for version; the latest format when omitted.

Parameters โ€‹

version? โ€‹

VersionProfile

Returns โ€‹

Record<string, unknown>


cubeAll() โ€‹

static cubeAll(texture): Model

Defined in: core/values/model.ts:53

A full-cube block model with one texture on every face (block/cube_all).

Parameters โ€‹

texture โ€‹

Texture

Returns โ€‹

Model


cubeColumn() โ€‹

static cubeColumn(side, end): Model

Defined in: core/values/model.ts:60

A column block model - end on top/bottom, side around (block/cube_column).

Parameters โ€‹

side โ€‹

Texture

end โ€‹

Texture

Returns โ€‹

Model


item() โ€‹

static item(texture): Model

Defined in: core/values/model.ts:46

A flat sprite item model (parent: item/generated, textures.layer0 = texture).

Parameters โ€‹

texture โ€‹

Texture

Returns โ€‹

Model

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.