Appearance
helix / Detect
Variable: Detect โ
constDetect:object
Defined in: core/frontend/detect.ts:57
Built-in detectors and combinators. Any closure of the same shape works too.
No any: a union can't merge into one chain and would run the body once per passing branch. Register two handlers instead.
Type Declaration โ
all() โ
readonlyall(...detectors):Detector
Every detector must hold, in one chain.
Order matters for cost: execute stops at the first failing clause, so put cheap, usually-false checks first.
Parameters โ
detectors โ
...Detector[]
Returns โ
always() โ
readonlyalways():Detector
Always passes, adding no clauses.
Returns โ
at() โ
readonlyat(pos,inner):Detector
Evaluate what follows positioned at pos (for ~/^-relative conditions).
Parameters โ
pos โ
inner โ
Returns โ
block() โ
readonlyblock(pos,block):Detector
if block <pos> <block> - the block at pos matches (id, state, or #tag).
Parameters โ
pos โ
block โ
Returns โ
entity() โ
readonlyentity(sel):Detector
if entity <sel> - at least one entity matches.
Parameters โ
sel โ
Returns โ
in() โ
readonlyin(dim,inner):Detector
Evaluates inner in dim.
Parameters โ
dim โ
inner โ
Returns โ
near() โ
readonlynear(pos,radius,inner):Detector
Evaluates inner only while a player is within radius of pos, so empty rooms cost one selector.
Parameters โ
pos โ
radius โ
number
inner โ
Returns โ
noEntity() โ
readonlynoEntity(sel):Detector
unless entity <sel> - nothing matches.
Parameters โ
sel โ
Returns โ
notBlock() โ
readonlynotBlock(pos,block):Detector
unless block <pos> <block> - the block at pos does not match.
Parameters โ
pos โ
block โ
Returns โ
notScore() โ
readonlynotScore(score,range):Detector
unless score <score> matches <range>.
Parameters โ
score โ
range โ
Returns โ
predicate() โ
readonlypredicate(ref):Detector
if predicate <ref> - hand the condition to a predicate JSON file.
Parameters โ
ref โ
PredicateLike
Returns โ
score() โ
readonlyscore(score,range):Detector
if score <score> matches <range>.