Denizen Script Tags


Tags are always written with a <between these marks>, and are critical to scripts, as the primary way to read data.
Learn about how tags work in The Beginner's Guide.


Showing 1 out of 2454 tags...
Name<LocationTag.ray_trace_target[(range=<#.#>/{200});(blocks=<{true}/false>);(fluids=<true/{false}>);(nonsolids=<true/{false}>);(entities=<matcher>);(ignore=<entity>|...);(raysize=<#.#>/{0})]>
ReturnsEntityTag
DescriptionTraces a line from this location towards the direction it's facing, returning the first hit entity (if any).
This is similar to Tag:LocationTag.precise_target and Tag:PlayerTag.target, except offering more options for how the ray trace is performed.
For ray tracing locations, see Tag:LocationTag.ray_trace.
Optionally specify:
range: (defaults to 200) a maximum distance (in blocks) to trace before giving up.
blocks: (defaults to true) specify "false" to ignore all blocks, solid or nonsolid or fluid, between this location and the target entity.
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 tall_grass) as solid, or "false" to ignore them.
entities: (defaults to none) specify an entity matcher for entities to ray trace for. Any non-matching entities along the way are ignored. Leave blank to match any entity.
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.
Example
# Removes the entity a player is looking at.
- define target <player.eye_location.ray_trace_target[ignore=<player>]||null>
- if <[target]> != null:
    - remove <[target]>
Example
# Returns any player within the view of an NPC.
- define target <npc.eye_location.ray_trace_target[entities=player;raysize=2]||null>
Example
# Highlights an entity through any number or types of blocks.
- define target <player.eye_location.ray_trace_target[ignore=<player>;blocks=false]||null>
- if <[target]> != null:
    - adjust <[target]> glowing:true
Synonyms (Search Aid)locationtag.raycast_target, locationtag.raytrace_target, locationtag.ray_cast_target
Groupworld
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/objects/LocationTag.java#L1824