Appearance
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? โ
optionalencode?: (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 โ
key โ
key:
string
Defined in: core/values/entity-nbt/fields.ts:20
The modern vanilla key.
since? โ
optionalsince?:"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? โ
optionaluntil?:"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? โ
optionalwas?:object
Defined in: core/values/entity-nbt/fields.ts:24
The older spelling (and encoding), used on versions before until.
encode? โ
optionalencode?: (value) =>NbtInput
Parameters โ
value โ
T
Returns โ
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"