Appearance
helix / ItemListView
Class: ItemListView โ
Defined in: core/frontend/nodes/data-view/items.ts:59
A list of item stacks keyed by Slot: a container's Items, or a copy kept in item or storage data.
ctx.entity(cart).items().append(bow.mag) // every stack in the bow's list
Extends โ
Constructors โ
Constructor โ
new ItemListView(
target,path):ItemListView
Defined in: core/frontend/nodes/data-view/view.ts:23
Parameters โ
target โ
NbtTargetSpec
path โ
Returns โ
ItemListView
Inherited from โ
Properties โ
path โ
readonlypath:NbtPathValue
Defined in: core/frontend/nodes/data-view/view.ts:25
Inherited from โ
target โ
readonlytarget:NbtTargetSpec
Defined in: core/frontend/nodes/data-view/view.ts:24
Inherited from โ
Methods โ
add() โ
add(
n):this
Defined in: core/frontend/nodes/data-view/view.ts:114
Adds n to a number.
Parameters โ
n โ
number
Returns โ
this
Inherited from โ
all() โ
all():
NbtView
Defined in: core/frontend/nodes/data-view/view.ts:48
Every element of this list.
Returns โ
Inherited from โ
append() โ
append(
stacks):this
Defined in: core/frontend/nodes/data-view/items.ts:66
Adds a stack (any view of one, like list.index(0)), or every stack of another list, at the end.
Parameters โ
stacks โ
SlottedStack | NbtView
Returns โ
this
Overrides โ
child() โ
child(
key):NbtView
Defined in: core/frontend/nodes/data-view/view.ts:38
The field key of this compound.
Parameters โ
key โ
string
Returns โ
Inherited from โ
clear() โ
clear():
this
Defined in: core/frontend/nodes/data-view/items.ts:71
Empties the list.
Returns โ
this
exists() โ
exists():
Detector
Defined in: core/frontend/nodes/data-view/view.ts:69
Holds when the path matches anything.
Returns โ
Inherited from โ
forEach() โ
forEach(
body):void
Defined in: core/frontend/nodes/data-view/list.ts:29
Runs body once per element, first to last.
Walks a copy, so body may change the list. Compiles to a ctx.while, so the command chain limit caps how long a list it can walk in one tick.
Parameters โ
body โ
(ctx, el) => void
Returns โ
void
Inherited from โ
get() โ
get():
Score
Defined in: core/frontend/nodes/data-view/view.ts:106
The value as a number, in a new local score; 0 if it's missing.
Returns โ
Inherited from โ
holder() โ
protectedholder(ctx?):NbtHolder
Defined in: core/frontend/nodes/data-view/view.ts:29
The holder the view lives in, in ctx.
Parameters โ
ctx? โ
Returns โ
NbtHolder
Inherited from โ
index() โ
index(
i):NbtView&Omit<DataView<StoredStack>, keyofNbtView>
Defined in: core/frontend/nodes/data-view/list.ts:18
Element i; negative counts from the end.
Parameters โ
i โ
number
Returns โ
NbtView & Omit<DataView<StoredStack>, keyof NbtView>
Inherited from โ
missing() โ
missing():
Detector
Defined in: core/frontend/nodes/data-view/view.ts:74
Holds when the path matches nothing.
Returns โ
Inherited from โ
ref() โ
ref():
NbtRef
Defined in: core/frontend/nodes/data-view/view.ts:64
This value, as a copy source or a text part.
Returns โ
Inherited from โ
remove() โ
remove():
this
Defined in: core/frontend/nodes/data-view/view.ts:100
Removes the value.
Returns โ
this
Inherited from โ
set() โ
set(
value,type?):this
Defined in: core/frontend/nodes/data-view/view.ts:89
Sets the value. A score is stored in real units, as type: an int by default, or a double for a scaled score.
Parameters โ
value โ
type? โ
StoreNumType
Returns โ
this
Inherited from โ
slot() โ
slot(
at):StackView
Defined in: core/frontend/nodes/data-view/items.ts:61
The stack at at.
Parameters โ
at โ
number
Returns โ
storeInto() โ
protectedstoreInto(chain,type?,factor?):ExecuteBuilder
Defined in: core/frontend/nodes/data-view/view.ts:127
execute store result into this value, as type times factor.
Parameters โ
chain โ
type? โ
StoreNumType = "int"
factor? โ
number = 1
Returns โ
Inherited from โ
toText() โ
toText():
this
Defined in: core/frontend/nodes/data-view/view.ts:121
Turns a number into its text, e.g. for a lore line that shouldn't show the number colour.
Returns โ
this
Inherited from โ
whenAtMost() โ
protectedwhenAtMost(score,n,body):void
Defined in: core/frontend/nodes/data-view/view.ts:135
Runs body when the number is at most n.
Parameters โ
score โ
n โ
number
body โ
() => void
Returns โ
void
Inherited from โ
where() โ
where(
filter):NbtView
Defined in: core/frontend/nodes/data-view/view.ts:59
The elements of this list that match filter.