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

helix / NbtRef

Class: NbtRef โ€‹

Defined in: core/frontend/nodes/nbt_ref.ts:13

A reference to NBT at a holder and path, usable as a copy source or a tellraw component.

Its own module so the tellraw handler can import it without data.ts's prototype augmentation.

Extends โ€‹

Constructors โ€‹

Constructor โ€‹

new NbtRef(target, path?): NbtRef

Defined in: core/frontend/nodes/nbt_ref.ts:19

Parameters โ€‹

target โ€‹

NbtTargetSpec

path? โ€‹

ArgInput

Returns โ€‹

NbtRef

Overrides โ€‹

TellrawPart.constructor

Properties โ€‹

clickEvent? โ€‹

optional clickEvent?: ClickEvent

Defined in: core/frontend/nodes/tellraw_part.ts:24

Inherited from โ€‹

TellrawPart.clickEvent


hoverEvent? โ€‹

optional hoverEvent?: HoverEvent

Defined in: core/frontend/nodes/tellraw_part.ts:25

Inherited from โ€‹

TellrawPart.hoverEvent


path? โ€‹

readonly optional path?: ArgInput

Defined in: core/frontend/nodes/nbt_ref.ts:21


style โ€‹

readonly style: TextStyle = {}

Defined in: core/frontend/nodes/tellraw_part.ts:23

Accumulated styling; each fluent method writes one field here.

Inherited from โ€‹

TellrawPart.style


target โ€‹

readonly target: NbtTargetSpec

Defined in: core/frontend/nodes/nbt_ref.ts:20

Methods โ€‹

bold() โ€‹

bold(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:33

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.bold


color() โ€‹

color(color): this

Defined in: core/frontend/nodes/tellraw_part.ts:28

Colours this span. Prefer Color.GOLD; #RRGGBB also works.

Parameters โ€‹

color โ€‹

Color | `#${string}`

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.color


font() โ€‹

font(id): this

Defined in: core/frontend/nodes/tellraw_part.ts:59

Renders this span in another font, e.g. minecraft:illageralt.

Parameters โ€‹

id โ€‹

string

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.font


interpret() โ€‹

interpret(): this

Defined in: core/frontend/nodes/nbt_ref.ts:44

Shows each value as a text component instead of as SNBT, so a string tag prints without quotes.

Returns โ€‹

this


italic() โ€‹

italic(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:38

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.italic


obfuscated() โ€‹

obfuscated(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:53

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.obfuscated


onClick() โ€‹

onClick(event): this

Defined in: core/frontend/nodes/tellraw_part.ts:71

Attach a click action (see the click helper).

Parameters โ€‹

event โ€‹

ClickEvent

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.onClick


onHover() โ€‹

onHover(event): this

Defined in: core/frontend/nodes/tellraw_part.ts:77

Attach a hover tooltip (see the hover helper).

Parameters โ€‹

event โ€‹

HoverEvent

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.onHover


separator() โ€‹

separator(part): this

Defined in: core/frontend/nodes/nbt_ref.ts:35

Sets what goes between values when the path matches several (list[]), as text; the game's default is ", ".

Parameters โ€‹

part โ€‹

TellrawPart

Returns โ€‹

this


shadowColor() โ€‹

shadowColor(argb): this

Defined in: core/frontend/nodes/tellraw_part.ts:65

Sets the drop shadow's colour as packed ARGB, e.g. 0x80000000. 0 hides it (1.21.4+).

Parameters โ€‹

argb โ€‹

number

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.shadowColor


slice() โ€‹

slice(start?, end?): DataSourceSpec

Defined in: core/frontend/nodes/nbt_ref.ts:50

Use a substring of the referenced string tag as the source.

Parameters โ€‹

start? โ€‹

number

end? โ€‹

number

Returns โ€‹

DataSourceSpec


strikethrough() โ€‹

strikethrough(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:48

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.strikethrough


underlined() โ€‹

underlined(value?): this

Defined in: core/frontend/nodes/tellraw_part.ts:43

Parameters โ€‹

value? โ€‹

boolean = true

Returns โ€‹

this

Inherited from โ€‹

TellrawPart.underlined


storage() โ€‹

static storage(id, path?): NbtRef

Defined in: core/frontend/nodes/nbt_ref.ts:27

A path in storage id, outside any function: for text in data files such as lore.

Parameters โ€‹

id โ€‹

Storage

path? โ€‹

NbtPathValue

Returns โ€‹

NbtRef

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