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

helix / FieldSpec

Interface: FieldSpec<T> โ€‹

Defined in: core/values/entity-nbt/fields.ts:18

One field's SNBT key, the versions it exists on, and how its value is encoded. The IR picks the key and drops absent fields for each version.

Type Parameters โ€‹

T โ€‹

T

Properties โ€‹

encode? โ€‹

optional encode?: (value) => NbtInput

Defined in: core/values/entity-nbt/fields.ts:22

JS value -> NBT value. Defaults to passing the value straight through.

Parameters โ€‹

value โ€‹

T

Returns โ€‹

NbtInput


key โ€‹

key: string

Defined in: core/values/entity-nbt/fields.ts:20

The modern vanilla key.


since? โ€‹

optional since?: "1.20.4" | "1.21.4" | "26.2" | "26.3" | "1.16" | "1.16.2" | "1.17" | "1.19" | "1.19.3" | "1.20" | "1.20.2" | "1.20.3" | "1.20.5" | "1.21" | "1.21.11" | "1.21.2" | "1.21.5" | "1.21.6" | "1.21.9" | "26.1" | "26.4"

Defined in: core/values/entity-nbt/fields.ts:26

The field does not exist before this version, and is dropped rather than emitted.


until? โ€‹

optional until?: "1.20.4" | "1.21.4" | "26.2" | "26.3" | "1.16" | "1.16.2" | "1.17" | "1.19" | "1.19.3" | "1.20" | "1.20.2" | "1.20.3" | "1.20.5" | "1.21" | "1.21.11" | "1.21.2" | "1.21.5" | "1.21.6" | "1.21.9" | "26.1" | "26.4"

Defined in: core/values/entity-nbt/fields.ts:28

The field was removed at this version, and is dropped from it on.


was? โ€‹

optional was?: object

Defined in: core/values/entity-nbt/fields.ts:24

The older spelling (and encoding), used on versions before until.

encode? โ€‹

optional encode?: (value) => NbtInput

Parameters โ€‹
value โ€‹

T

Returns โ€‹

NbtInput

key โ€‹

key: string

until โ€‹

until: "1.20.4" | "1.21.4" | "26.2" | "26.3" | "1.16" | "1.16.2" | "1.17" | "1.19" | "1.19.3" | "1.20" | "1.20.2" | "1.20.3" | "1.20.5" | "1.21" | "1.21.11" | "1.21.2" | "1.21.5" | "1.21.6" | "1.21.9" | "26.1" | "26.4"

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