Appearance
helix / Player
Class: Player
Defined in: core/frontend/nodes/player.ts:6
Extends
Constructors
Constructor
new Player(
fn,playerName):Player
Defined in: core/frontend/nodes/player.ts:7
Parameters
fn
playerName
string
Returns
Player
Overrides
Properties
playerName
playerName:
string
Defined in: core/frontend/nodes/player.ts:9
Accessors
selector
Get Signature
get selector():
string
Defined in: core/frontend/nodes/player.ts:14
Returns
string
Methods
build()
build():
SelectorNode
Defined in: core/frontend/nodes/selector.ts:170
Returns
SelectorNode
Inherited from
distance()
distance(
range):this
Defined in: core/frontend/nodes/selector.ts:124
Restrict to entities within a distance range of the execution position (distance=<range>). Pass a Range so e.g. ..6 (within 6 blocks) or 2.. is modelled as a value, not a hand-built distance=..6 string.
Parameters
range
Returns
this
Inherited from
gamemode()
gamemode(
mode):this
Defined in: core/frontend/nodes/selector.ts:142
Restrict to a game mode (gamemode=survival|creative|adventure|spectator). Prefer the typed Gamemode.SURVIVAL over a bare string.
Parameters
mode
Returns
this
Inherited from
giveItem()
giveItem(
item,count?):void
Defined in: core/frontend/nodes/player.ts:18
Parameters
item
count?
number = 1
Returns
void
limit()
limit(
n):this
Defined in: core/frontend/nodes/selector.ts:83
Parameters
n
number
Returns
this
Inherited from
name()
name(
name):this
Defined in: core/frontend/nodes/selector.ts:96
Parameters
name
string
Returns
this
Inherited from
nbt()
nbt(
nbt):this
Defined in: core/frontend/nodes/selector.ts:151
Restrict to entities matching nbt (nbt={…}). Pass an Nbt value rather than a hand-built SNBT string so it renders version-aware at codegen.
Parameters
nbt
Returns
this
Inherited from
predicate()
predicate(
ref):this
Defined in: core/frontend/nodes/selector.ts:163
Restrict to entities passing a registered predicate (predicate=<id>). Accepts a PredicateRef (from dp.predicate(...)), an Id, or a raw id string. This is the cheap, engine-evaluated stand-in for inlining an nbt={…} match into the selector - register the check once as a Predicate, reference it everywhere. Repeatable to AND several predicates.
Parameters
ref
string | IdValue | PredicateRef
Returns
this
Inherited from
render()
render(
version?):string
Defined in: core/frontend/nodes/selector.ts:203
CommandValue form. Most selector args are version-neutral, but an nbt={…} arm renders its Nbt version-aware, so the codegen version is threaded through here. Lets a Selector be passed to any concept-typed entity argument (entity, score_holder, ...).
Parameters
version?
Returns
string
Inherited from
run()
run(
fn): (ctx) =>void
Defined in: core/frontend/nodes/selector.ts:207
Parameters
fn
(ctx) => void
Returns
(ctx) => void
Inherited from
score()
score(
objective,range):this
Defined in: core/frontend/nodes/selector.ts:73
Parameters
objective
range
Returns
this
Inherited from
sort()
sort(
order):this
Defined in: core/frontend/nodes/selector.ts:88
Order multi-match results (sort=). Prefer the typed Sort.NEAREST over a bare string.
Parameters
order
Returns
this
Inherited from
tag()
tag(
name):this
Defined in: core/frontend/nodes/selector.ts:78
Parameters
name
string
Returns
this
Inherited from
team()
team(
name):this
Defined in: core/frontend/nodes/selector.ts:92
Parameters
name
string
Returns
this
Inherited from
toString()
toString():
string
Defined in: core/frontend/nodes/selector.ts:193
The selector's command-string form, so a Selector can be passed directly as an argument to any command method (which stringify their args).
Returns
string
Inherited from
volume()
volume(
from,to):this
Defined in: core/frontend/nodes/selector.ts:107
Restrict to entities whose hitbox overlaps the axis-aligned box between two corners (x=…,y=…,z=…,dx=…,dy=…,dz=…). Corner order doesn't matter - the lower corner and absolute spans are derived. Replaces hand-built volume selector strings.
Parameters
from
readonly [number, number, number]
to
readonly [number, number, number]
Returns
this
Inherited from
xRotation()
xRotation(
range):this
Defined in: core/frontend/nodes/selector.ts:130
Restrict by vertical look angle (x_rotation=<range>).
Parameters
range
Returns
this
Inherited from
yRotation()
yRotation(
range):this
Defined in: core/frontend/nodes/selector.ts:136
Restrict by horizontal look angle (y_rotation=<range>).
Parameters
range
Returns
this
Inherited from
allEntities()
staticallEntities():Selector
Defined in: core/frontend/nodes/selector.ts:56
Returns
Inherited from
allPlayers()
staticallPlayers():Selector
Defined in: core/frontend/nodes/selector.ts:53
Returns
Inherited from
nearest()
staticnearest():Selector
Defined in: core/frontend/nodes/selector.ts:59
Returns
Inherited from
random()
staticrandom():Selector
Defined in: core/frontend/nodes/selector.ts:62
Returns
Inherited from
self()
staticself():Selector
Defined in: core/frontend/nodes/selector.ts:65
Returns
Inherited from
uuid()
staticuuid(id):Selector
Defined in: core/frontend/nodes/selector.ts:69
A selector that is a bare entity UUID or player name (its own base form).
Parameters
id
string