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

helix / NbtPathValue

Class: NbtPathValue โ€‹

Defined in: core/values/nbt/path.ts:29

An NBT path (nbt_path), rendered verbatim:

NbtPath("Inventory[0].id") -> "Inventory[0].id"

Implements โ€‹

Constructors โ€‹

Constructor โ€‹

new NbtPathValue(path): NbtPathValue

Defined in: core/values/nbt/path.ts:30

Parameters โ€‹

path โ€‹

string

Returns โ€‹

NbtPathValue

Methods โ€‹

all() โ€‹

all(): NbtPathValue

Defined in: core/values/nbt/path.ts:51

Every element of the list: Items[].

Returns โ€‹

NbtPathValue


child() โ€‹

child(name): NbtPathValue

Defined in: core/values/nbt/path.ts:41

Descend into a compound tag: Path.Player.abilities.child("mayfly"). Quotes keys like minecraft:custom_data.

Parameters โ€‹

name โ€‹

string

Returns โ€‹

NbtPathValue


index() โ€‹

index(i): NbtPathValue

Defined in: core/values/nbt/path.ts:36

Indexes into a list: Path.Entity.Pos.index(1) -> Pos[1]. Returns a new path.

Parameters โ€‹

i โ€‹

number

Returns โ€‹

NbtPathValue


render() โ€‹

render(): string

Defined in: core/values/nbt/path.ts:31

Returns โ€‹

string

Implementation of โ€‹

CommandValue.render


where() โ€‹

where(filter): NbtPathValue

Defined in: core/values/nbt/path.ts:46

The list elements that match filter: NbtPath("Items").where({ Slot: Byte(3) }) -> Items[{Slot:3b}].

Parameters โ€‹

filter โ€‹

Returns โ€‹

NbtPathValue


within() โ€‹

within(other): boolean

Defined in: core/values/nbt/path.ts:56

Whether this path is other or inside it: Pos[1] is within Pos.

Parameters โ€‹

other โ€‹

NbtPathValue

Returns โ€‹

boolean

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