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

helix / EntityNbtValue

Class: EntityNbtValue โ€‹

Defined in: core/values/entity-nbt/value.ts:6

An entity's NBT, assembled from its schema at codegen against the target version.

Extends โ€‹

Extended by โ€‹

Constructors โ€‹

Constructor โ€‹

new EntityNbtValue(schema, fields, entity?, withId?): EntityNbtValue

Defined in: core/values/entity-nbt/value.ts:8

Parameters โ€‹

schema โ€‹

Record<string, FieldSpec<never>>

fields โ€‹

Record<string, unknown>

entity? โ€‹

string

The entity this schema curates, when it names one - summon infers the type from it.

withId? โ€‹

boolean = false

Whether to write the entity's own id key - see asPassenger.

Returns โ€‹

EntityNbtValue

Overrides โ€‹

NbtValue.constructor

Properties โ€‹

entity? โ€‹

readonly optional entity?: string

Defined in: core/values/entity-nbt/value.ts:12

The entity this schema curates, when it names one - summon infers the type from it.


fields โ€‹

readonly fields: Record<string, unknown>

Defined in: core/values/entity-nbt/value.ts:10


lowered โ€‹

protected readonly lowered: true = true

Defined in: core/values/value.ts:14

Tells lowered values apart from plain objects (e.g. NBT compounds).

Inherited from โ€‹

NbtValue.lowered


schema โ€‹

readonly schema: Record<string, FieldSpec<never>>

Defined in: core/values/entity-nbt/value.ts:9


value โ€‹

readonly value: NbtInput

Defined in: core/values/nbt/snbt.ts:27

Inherited from โ€‹

NbtValue.value


withId โ€‹

readonly withId: boolean = false

Defined in: core/values/entity-nbt/value.ts:14

Whether to write the entity's own id key - see asPassenger.

Methods โ€‹

asPassenger() โ€‹

asPassenger<T>(this): T

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

A copy that also writes its own id, for nested entities like Passengers.

Type Parameters โ€‹

T โ€‹

T extends EntityNbtValue

Parameters โ€‹

this โ€‹

T

Returns โ€‹

T


keys() โ€‹

keys(): string[] | undefined

Defined in: core/values/nbt/snbt.ts:32

The top-level keys of a compound, or undefined for raw SNBT or anything else.

Returns โ€‹

string[] | undefined

Inherited from โ€‹

NbtValue.keys


tagged() โ€‹

tagged<T>(this, ...names): T

Defined in: core/values/entity-nbt/value.ts:25

A copy with extra Tags appended, so a caller can find what it summoned.

Type Parameters โ€‹

T โ€‹

T extends EntityNbtValue

Parameters โ€‹

this โ€‹

T

names โ€‹

...string[]

Returns โ€‹

T

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