Target (Expression) — Skript
Addon: Skript · Category: Expression · Since: 1.4.2, 2.7 (Reset), 2.8.0 (ignore blocks, ray size)
Syntax
[the] target[[ed] %-*entitydata%] [of %livingentities%] [ignoring blocks] [[with|at] [a] ray[ ]size [of] %-number%]Description
For players this is the entity at the crosshair. For mobs and experience orbs this is the entity they are attacking/following (if any). The 'ray size' and 'ignoring blocks' options are only valid for players' targets. The 'ray size' option effectively increases the area around the crosshair an entity can be in. It does so by expanding the hitboxes of entities by the given amount. Display entities have a hit box of 0, so using the 'ray size' option can be helpful when targeting them. May grab entities in unloaded chunks.
Examples
on entity target:
if entity's target is a player:
send "You're being followed by an %entity%!" to target of entity
reset target of entity # Makes the entity target-lessdelete targeted entity of player # for players it will delete the targetdelete target of last spawned zombie # for entities it will make them target-less