Appearance
spool / RaycastOptions
Interface: RaycastOptions โ
Defined in: plugins/raycast/index.ts:17
Options for a block raycast that marches ^ through air and runs onHit at the first block.
No entities or macros. You decide what a hit does; hitOn filters which blocks count.
Properties โ
hitOn? โ
readonlyoptionalhitOn?:Block
Defined in: plugins/raycast/index.ts:28
Blocks that count as a hit (id or Block.tag(...)). Default: any non-air block. The ray still stops at the first non-air block; a non-match is a miss.
maxSteps โ
readonlymaxSteps:number
Defined in: plugins/raycast/index.ts:21
Maximum reach, in steps of stepBlocks.
name โ
readonlyname:string
Defined in: plugins/raycast/index.ts:19
Function path suffix and step-slot name (raycast/<name>). Must be unique per pack.
stepBlocks? โ
readonlyoptionalstepBlocks?:number
Defined in: plugins/raycast/index.ts:23
Stride per step along the line of sight, in blocks. Default 0.5.
stopAt? โ
readonlyoptionalstopAt?:Selector
Defined in: plugins/raycast/index.ts:38
Entities that end the ray early and run onReach instead of onHit.
Turns the ray into a line-of-sight check. Give it distance slack, since the ray samples every stepBlocks and distance measures to feet.
through? โ
readonlyoptionalthrough?:Block
Defined in: plugins/raycast/index.ts:30
Blocks the ray passes through. Default: air.
Methods โ
onHit()? โ
optionalonHit(ctx):void
Defined in: plugins/raycast/index.ts:49
Runs at the hit block (only matching blocks with hitOn). Optional for pure line-of-sight rays.
Parameters โ
ctx โ
FunctionContext
Returns โ
void
onReach()? โ
optionalonReach(ctx):void
Defined in: plugins/raycast/index.ts:44
Runs where stopAt matched. Ending it with ctx.return_(1) makes the whole ray return 1, so execute if function <ref>.cast is a line-of-sight test.
Parameters โ
ctx โ
FunctionContext
Returns โ
void