Raycast from Location
Traces from the origin along its direction, using the Entity Collision and Block Collision tags. Distance is limited to 0–256 blocks.
Where to find it
Section titled “Where to find it”Set Variable → Operations → Choose Operation → Location. Requires Dev access to configure, then a successful compile to activate.
Inputs
Section titled “Inputs”| Input | Type | Role | Requirement | Default / constraint |
|---|---|---|---|---|
| Result | Location | Variable binding | Required | Required |
| Ray Origin | Location | Value | Required | Required |
| Ray Distance (0–256) | Number | Value | Required | Required |
Options and tags
Section titled “Options and tags”| Option | Default | Choices |
|---|---|---|
| Entity Collision | False | True, False |
| Block Collision | All blocks | All blocks, Non-fluid blocks, Solid blocks, None |
These choices belong to the operation configuration, not additional positional arguments.
Result and behavior
Section titled “Result and behavior”Stores the result in the first configured destination Variable. Its type must match the result and any generic element/key types.
Configuration example
Section titled “Configuration example”Block: Set Variable → OperationsOperation: Raycast from LocationResult: Private Location resultRay Origin: Location A in the play areaRay Distance (0–256): 1Use this as an editor configuration: declare any Variables/collections first and choose real locations/eligible targets for your plot. It is not pasteable source code.
Restrictions and troubleshooting
Section titled “Restrictions and troubleshooting”Use locations and entities in the current plot. World-changing behavior cannot edit protected code areas or escape plot bounds.
Related guides
Section titled “Related guides”Editor · Arguments · Targets · Expressions · Native behavior
Reference identifier: location.raycast.