> ## Documentation Index
> Fetch the complete documentation index at: https://entities.lodemc.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Targeters

> Who or where an effect line acts on: every targeter, and the options they share.

A targeter decides **who or where** a line acts on. It's the part prefixed with `@`:

```yaml theme={null}
- damage{amount=6}  +onHurt  @trigger
- particlering{p=flame;radius=3} @selfLocation
```

A line with no targeter acts on `@self`, the mob itself.

## How targeters are written

Options go in braces, MythicMobs-style. The older bracket form still works for the radius targeters:

```yaml theme={null}
- damage{amount=8} @playersInRadius{r=5}
- damage{amount=8} @PIR{r=5}             # MythicMobs' short alias
- damage{amount=8} @playersRadius[5]      # the bracket form
```

Names are case-insensitive. A targeter can resolve to nobody, one entity or many; the mechanic runs once **per target**. Finding nobody is not an error: the line just does nothing.

There are two kinds:

* **Entity targeters** pick entities: `@self`, `@trigger`, `@playersInRadius`.
* **Location targeters** pick points in the world: `@selfLocation`, `@forward{f=5}`, `@ring{r=4;p=12}`. Mechanics that place things (`summon`, particles, `explosion`, blocks) work on locations. Mechanics that need an entity skip a location target.

## `@self`, `@target` and `@trigger`

| Targeter | Is |
| :- | :- |
| `@self` | The caster. |
| `@trigger` | The entity that fired the trigger: the attacker on `+onHurt`, the victim on `+onAttack`, the clicker on `+onInteract`. |
| `@target` | The caster's **current target**: a mob's AI target, or the entity a player is looking at. When there is none, the trigger entity. |

For "hit back at whoever hit me", `@trigger` is the exact one. `@target` is whoever the mob is chasing, which is what an aimed attack wants.

## Options every entity targeter takes

Area targeters (`@playersInRadius`, `@entitiesInRadius`, rings, cones, the world) start from MythicMobs' defaults: they skip the caster, players in creative or spectator, armor stands and markers. Single-entity targeters like `@self` and `@trigger` skip nothing unless you ask.

| Option | What it does |
| :- | :- |
| `limit=3` | Keep at most this many. |
| `sort=NEAREST` | Order before limiting: `NEAREST`, `FURTHEST`, `RANDOM`, `LOWEST_HEALTH`, `HIGHEST_HEALTH`, `HIGHEST_THREAT`, `LOWEST_THREAT`. |
| `stuti=1` | Skip the first N after sorting (`skipTargetsUpToIndex`). |
| `types=zombie,crypt_warden` | Only these vanilla types or LodeEntities mob ids. |
| `ignore=villager` | Never these. |
| `conditions=[ - isPlayer - health{h=<10} ]` | Only targets that pass these [conditions](https://entities.lodemc.net/conditions.md). |
| `targetSelf`, `targetPlayers`, `targetCreative`, `targetSpectator`, `targetArmorStands`, `targetMarkers`, `targetNPCs`, `targetAnimals`, `targetCreatures`, `targetVillagers`, `targetSameFaction`, `targetOwner` | `true` or `false`: include or exclude that kind of entity. |

```yaml theme={null}
- damage{a=10} @playersInRadius{r=20;sort=LOWEST_HEALTH;limit=1}    # finish off the weakest player
- heal{a=20}   @mobsInRadius{r=16;types=crypt_minion}                 # heal the minions
```

## Options every location targeter takes

| Option | What it does |
| :- | :- |
| `x`, `y`, `z` | Offset in world axes: `@selfLocation{y=2}`. |
| `forwardoffset` (`fo`), `sideoffset` (`so`) | Offset relative to where the caster faces. |
| `coordinatex` (`cx`), `cy`, `cz`, `cyaw`, `cpitch` | Replace a coordinate outright. |
| `blockCentered` | Snap to the middle of the block. |
| `blocktypes` (`bt`), `blockignores` (`bi`) | Only, or never, points whose block is one of these. |
| `limit`, `sort` | As above. |

## Entity targeters

| Targeter | What it targets |
| :- | :- |
| `@self` <sub>also @caster, @boss, @mob</sub> | The caster itself. The default when a line names no targeter. |
| `@target` <sub>also @t</sub> | The caster's current target: a mob's AI target, a player's crosshair entity, or else the entity that fired the trigger. |
| `@trigger` | The entity that fired the trigger: the attacker on `+onHurt`, the victim on `+onAttack`, the clicker on `+onInteract`. |
| `@targeted` <sub>also @targetedTarget</sub> | The targets handed down by the line that called this skill. |
| `@owner` | The caster's owner (set by `summon` or `setowner`). |
| `@wolfOwner` | The tamed owner of a wolf, cat or other tameable caster. |
| `@parent` <sub>also @summoner</sub> | The mob that summoned the caster. |
| `@children` <sub>also @child, @summons</sub> | Every mob the caster has summoned. |
| `@siblings` <sub>also @sibling, @brothers, @sisters</sub> | Every other mob summoned by the caster's parent. |
| `@father` <sub>also @dad, @daddy</sub> | The first parent of a bred caster. |
| `@mother` <sub>also @mommy, @mom</sub> | The second parent of a bred caster. |
| `@mount` | The mount the caster summoned with `mount`. |
| `@vehicle` | Whatever the caster is riding. |
| `@passenger` <sub>also @rider</sub> | Whatever is riding the caster. |
| `@interactionLastAttacker` <sub>also @lastattacker</sub> | The last entity to attack an interaction entity caster. |
| `@interactionLastInteract` <sub>also @lastinteract</sub> | The last player to click an interaction entity caster. |
| `@uuid{uuid=<uuid>}` | One entity, by UUID. |
| `@playerByName{name=<name>}` <sub>also @specificplayer</sub> | One online player, by name. |
| `@threatTable` <sub>also @threattargets, @tt</sub> | Everything on the caster's threat table. |
| `@threatTablePlayers` <sub>also @playersinthreattable, @ttp</sub> | Every player on the caster's threat table. |
| `@randomThreatTarget` <sub>also @rtt</sub> | One random entry from the caster's threat table. |
| `@playersInRadius{r=<radius>}` <sub>also @pir</sub> | Players within `r` blocks of the caster. |
| `@playersRadius[<radius>]` <sub>also @pr</sub> | The short form of `@playersInRadius`: `@playersRadius[20]`. |
| `@nearestPlayer{r=<radius>}` <sub>also @np</sub> | The closest player within `r` blocks (default 32). |
| `@playersNearOrigin{r=<radius>}` <sub>also @playersnearsource, @pno</sub> | Players within `r` blocks of the skill's origin. |
| `@playersInRing{min=<r>;max=<r>}` <sub>also @pring</sub> | Players between `min` and `max` blocks from the caster. |
| `@playersNearTargetLocations{r=<radius>}` <sub>also @playersneartargetlocation, @pntl</sub> | Players near the inherited target locations. |
| `@playersInWorld` <sub>also @world</sub> | Every player in the caster's world. |
| `@playersOnServer` <sub>also @server, @everyone</sub> | Every player online. |
| `@trackedPlayers` <sub>also @tracked</sub> | Players close enough to see the caster. |
| `@entitiesInRadius{r=<radius>}` <sub>also @livingentitiesinradius, @livinginradius, @allinradius, @eir</sub> | Living entities within `r` blocks of the caster. |
| `@entitiesRadius[<radius>]` <sub>also @er</sub> | The short form of `@entitiesInRadius`: `@entitiesRadius[10]`. |
| `@mobsRadius[<radius>]` <sub>also @mr</sub> | Living non-players within `N` blocks: `@mobsRadius[10]`. |
| `@mobsInRadius{r=<radius>;types=<ids>}` <sub>also @mobs, @mir</sub> | Mobs of the listed types (LodeEntities ids or vanilla types) within `r` blocks. |
| `@mobsNearOrigin{r=<radius>;types=<ids>}` <sub>also @mobssnearsource</sub> | Mobs of the listed types near the skill's origin. |
| `@entitiesNearOrigin{r=<radius>}` <sub>also @nearorigin, @eno</sub> | Living entities near the skill's origin. |
| `@notLivingNearOrigin{r=<radius>}` <sub>also @nlno, @nonlivingnearorigin</sub> | Non-living entities (items, displays, …) near the skill's origin. |
| `@entitiesInRing{min=<r>;max=<r>}` <sub>also @eirr</sub> | Living entities between `min` and `max` blocks from the caster. |
| `@entitiesInRingNearOrigin{min=<r>;max=<r>}` <sub>also @erno</sub> | Living entities in a ring around the skill's origin. |
| `@livingNearTargetLocation{r=<radius>}` <sub>also @livingentitiesneartargetlocation, @lntl, @entl, @ent</sub> | Living entities near the inherited target locations. |
| `@livingInCone{angle=<deg>;range=<r>}` <sub>also @entitiesincone, @livingentitiesincone, @leic, @eic</sub> | Living entities inside a cone in front of the caster. |
| `@livingInLine{r=<width>}` <sub>also @entitiesinline, @livingentitiesinline, @leil, @eil</sub> | Living entities along a line from the caster to the target location. |
| `@livingInWorld` <sub>also @entitiesinworld, @livingentitiesinworld, @allinworld, @eiw</sub> | Every living entity in the caster's world. |
| `@itemsInRadius{r=<radius>}` <sub>also @iir</sub> | Dropped items within `r` blocks of the caster. |
| `@itemsNearOrigin{r=<radius>}` <sub>also @ino</sub> | Dropped items near the skill's origin. |

## Location targeters

| Targeter | What it targets |
| :- | :- |
| `@selfLocation` <sub>also @casterlocation, @bosslocation, @moblocation</sub> | The caster's position. |
| `@selfEyeLocation` <sub>also @eyedirection, @castereyelocation, @bosseyelocation, @mobeyelocation</sub> | The caster's eye position. |
| `@origin` <sub>also @source</sub> | Where the current skill started (a projectile's hit point, for example). |
| `@triggerLocation` | The trigger entity's position. |
| `@targetLocation` <sub>also @targetloc, @tl</sub> | The caster's target's position, or the block a player is looking at. |
| `@targetBlock` | The block the caster is looking at. |
| `@targetedLocation` <sub>also @targetedlocations, @targetedloc</sub> | The locations handed down by the calling line. |
| `@locationsOfTargets` <sub>also @locationoftarget, @lot</sub> | The positions of the inherited entity targets. |
| `@spawnLocation` <sub>also @casterspawnlocation, @casterspawn</sub> | Where the caster spawned. |
| `@trackedLocation` | The location stored with `settrackedlocation`. |
| `@ownerLocation` | The caster's owner's position. |
| `@parentLocation` <sub>also @summonerlocation</sub> | The caster's parent's position. |
| `@randomThreatTargetLocation` <sub>also @rttl</sub> | The position of a random entry on the threat table. |
| `@location{c=<x,y,z>}` <sub>also @loc, @l</sub> | Fixed coordinates: `@location{c=10,64,-20}`. |
| `@variableLocation{var=<name>}` <sub>also @varlocation</sub> | A location stored in a variable. |
| `@pin{p=<name>}` | A named pin's position (see `movepin`). |
| `@spawners{s=<ids>}` | The positions of the listed spawners. |
| `@highestBlock` | The highest block above the skill's origin. |
| `@floorOfTargets` <sub>also @floorsoftarget, @fot</sub> | The first solid block under each inherited target. |
| `@obstructingBlock` | Blocks in front of the caster that are in its way. |
| `@nearestStructure{type=<structure>}` | The nearest structure of a type. |
| `@projectileForward{f=<distance>}` | A point in front of the projectile running the skill. |
| `@none` <sub>also @console</sub> | Nothing. For lines that need no target. |
| `@forward{f=<distance>}` | A point `f` blocks in front of the caster. |
| `@forwardWall{f=<distance>;w=<width>;h=<height>}` | A wall of points in front of the caster. |
| `@line{r=<spacing>}` | Points along a line from the caster to the target location. |
| `@ring{r=<radius>;p=<points>}` | Points in a ring around the caster. |
| `@ringAroundOrigin{r=<radius>;p=<points>}` <sub>also @ringorigin, @rao</sub> | Points in a ring around the skill's origin. |
| `@randomRingPoint{r=<radius>;p=<points>;a=<amount>}` | Random points on a ring around the caster. |
| `@cone{angle=<deg>;range=<r>;points=<n>}` | Random points in a cone in front of the caster. |
| `@sphere{r=<radius>;p=<points>}` | Points on a sphere around the caster. |
| `@rectangle{x=<w>;y=<h>;z=<d>}` <sub>also @cube, @cuboid</sub> | Points filling a box around the caster. |
| `@randomLocationsNearCaster{a=<n>;r=<radius>}` <sub>also @rlnc, @randomlocations</sub> | Random spots near the caster. |
| `@randomLocationsNearOrigin{a=<n>;r=<radius>}` <sub>also @rlo, @randomlocationsorigin, @rlno</sub> | Random spots near the skill's origin. |
| `@randomLocationsNearTargets{a=<n>;r=<radius>}` <sub>also @rlnt, @rlnte, @rlntl</sub> | Random spots near the inherited targets. |
| `@playerLocationsInRadius{r=<radius>}` <sub>also @locationradius, @plir, @plr</sub> | The positions of players within `r` blocks. |
| `@playerLocationByName{name=<name>}` <sub>also @specificplayerlocation</sub> | One online player's position, by name. |
| `@relativeLocationInLoadedChunks` <sub>also @rellocationinloadedchunks</sub> | The target's chunk-relative position, repeated in every loaded chunk. |
| `@blocksInRadius{r=<radius>}` <sub>also @bir</sub> | Every block within `r` of the inherited target. |
| `@blocksNearOrigin{r=<radius>}` <sub>also @bno</sub> | Every block within `r` of the skill's origin. |
| `@blocksInChunk` <sub>also @bic</sub> | Every block in the target's chunk. Use `blocktypes` to narrow it. |
| `@blockVein{bt=<types>;limit=<n>}` <sub>also @vein, @bv</sub> | Connected blocks of the listed types, like an ore vein. |
| `@blocksInPinRegion{p1=<pin>;p2=<pin>}` | Every block between two pins. |
| `@region{min=<x,y,z>;max=<x,y,z>}` | A box between two corners, for mechanics that work on regions. |
| `@chunksInWERegion{region=<name>}` <sub>also @chunksinwgregion</sub> | The chunks of a WorldGuard region. Needs WorldGuard. |

## Targeters inside skills

A line inside a [skill](https://entities.lodemc.net/named-effects.md) with no targeter **inherits** the targets of the line that called it. A line with its own `@` overrides them, and `@targeted` reaches back for the inherited ones explicitly:

```yaml theme={null}
  effects:
  - skill{s=smash} +onHurt @trigger      # smash runs against the attacker...
  smash:
  - lunge{velocity=1.6}                  # ...this line inherits that target
  - damage{amount=10} @playersRadius[4]  # ...this one picks its own
```

## On Folia

`@playersInWorld`, `@playersOnServer` and `@livingInWorld` reach entities in other regions. Sending them text and sounds is fine; damaging or moving them from another region is not safe on Folia. Prefer the radius targeters, which only see the caster's own region. See [Folia](https://entities.lodemc.net/folia.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.