Skip to main content
Targets the entity that caused the trigger. Who that is depends on the trigger the line uses: Alias: @trigger

When to use it

@target is how mobs react to the specific entity that did something to them: counterattacks, thorns damage, replies to a click, rewards for the killer.

When it resolves to nothing

@target can be empty, and the line then does nothing:
  • On #onSpawn, always. A spawn has no causing entity.
  • On #onHurt and #onDeath when the damage was environmental. Fall damage, fire and cactus have no attacker.
If an effect must always run, use @self, a radius targeter, or @world instead.

Target variables

@target pairs with the target. variable scope and placeholders. <target.name> in a message resolves per recipient, and target.var.x reads a variable stored on the targeted entity: