Name | <LocationTag.ray_trace[(range=<#.#>/{200});(return=<{precise}/block/normal>);(default=<{null}/air>);(fluids=<true/{false}>);(nonsolids=<true/{false}>);(entities=<matcher>);(ignore=<entity>|...);(raysize=<#.#>/{0})]> |
Returns | LocationTag |
Description | Traces a line from this location towards the direction it's facing, returning the location of the first hit block or (optionally) entity.
This tag has also been referred to as 'cursor_on' or 'precise_cursor_on' in the past. For ray tracing entities, see LocationTag.ray_trace_target. Using 'return=normal' instead replaces the old 'precise_impact_normal' tag. Optionally specify: range: (defaults to 200) a maximum distance (in blocks) to trace before giving up. return: (defaults to precise) specify "precise" to return the exact location of the hit (if it hits a block, returns a location along the edge of the block -- but if it hits an entity, returns a location along the body of the entity) "normal" to return the normal vector of the impact location, or "block" to return the location of the block hit (if it hits an entity, returns equivalent to 'precise') For "precise" and "block", the location's direction is set to the direction of the block face hit (or entity bounding box face), pointing exactly away from whatever was hit (the 'normal' direction). default: (defaults to "null") specify "null" to return null when nothing is hit, or "air" to return the location of the air at the end of the trace (NOTE: can potentially be in water or other ignored block type, not just literal air). fluids: (defaults to false) specify "true" to count fluids like water as solid, or "false" to ignore them. nonsolids: (defaults to false) specify "true" to count passable blocks (like tallgrass) as solid, or false to ignore them. entities: (defaults to none) specify an entity matcher for entities to count as blocking the trace, "*" for any entity counts, or leave off (or empty) to ignore entities. ignore: (defaults to none) optional list of EntityTags to ignore even if they match the matcher. raysize: (defaults to 0) sets the radius of the ray being used to trace entities (and NOT for blocks!). |
Example |
|
Example |
|
Example |
|
Synonyms (Search Aid) | locationtag.raycast, locationtag.raytrace, locationtag.ray_cast |
Group | world |
Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L1728 |