From Terraria Wiki
Jump to: navigation, search

Aggro is an invisible statistic that determines the distance at which NPCs will begin to attack the player. Aggro is short for "aggression," and is a common mechanic in video games. Terraria features various items that can alter this statistic when equipped.

All enemies target the player based on criteria set in their AI. Most will constantly try for a target, while others may only target if the player is in water, etc.

Currently, the Stardust Guardian is the only summon able to divert an NPC's target away from the player. It overrides the player's presence, but only if it is closer than 200 pixels from said NPC. Otherwise, an NPC may target the player or the Guardian — whichever is closer. It is best to summon the Stardust Guardian closer to hordes of enemies, rather than a small few, to avoid being targeted when a few enemies disperse or die.

Armor and other items that "increases/decreases enemy targeting" make enemies "think" a player is closer or farther away than they actually are. So if you have a Stardust Guardian close to an NPC, but have accessories that increase your aggro, then you could be considered "closer" than the Stardust Guardian is, and you may temporarily be targeted instead of the Guardian.

If the Eternia Crystal is present, the Old One's Army will target it by default, only targeting the player or Guardian if they get "in the way".

Gear[edit | edit source]

Decrease[edit | edit source]

These items reduce the player's "aggro" statistic, meaning that NPCs will have to get closer to target the player.

Item Aggro change
Invisibility Potion.png Invisibility Potion -750 while not swinging an item
-250 while swinging an item
Apprentice's Scarf.png Apprentice's Scarf Pc only.png -400
Huntress's Buckler.png Huntress's Buckler Pc only.png -400
Monk's Belt.png Monk's Belt Pc only.png -400
Squire's Shield.png Squire's Shield Pc only.png -400
Putrid Scent.png Putrid Scent Pc only.png -400
Psycho Knife.png Psycho Knife Pc only.png In stealth mode, aggro is decreased based on visibility to a cap of -750
Shroomite armor.png Shroomite armor
(full set)
In stealth mode, aggro is decreased based on visibility to a cap of -750
Vortex armor.png Vortex armor
(full set)
In stealth mode, aggro is decreased based on visibility to a cap of -1200
  • Aggro reductions of -750 nearly guarantee the player will not be targeted.
  • Vortex armor provides the largest aggro reduction available in the game.

Increase[edit | edit source]

These items increase the player's aggro statistic, meaning that NPCs can be farther from the player and still target them.

Item Aggro change
Turtle armor.png Turtle armor
(full set)
Beetle Helmet.png Beetle Helmet +250
Beetle Leggings.png Beetle Leggings +400
Solar Flare Helmet.png Solar Flare Helmet +300
Solar Flare Breastplate.png Solar Flare Breastplate +300
Solar Flare Leggings.png Solar Flare Leggings +300
Flesh Knuckles.png Flesh Knuckles Pc only.png +400

Formula[edit | edit source]

Most NPCs will only attack the target they are closest to. They will determine the player's distance first, then the Stardust Guardian's (if applicable) and finally the distance to the Eternia Crystal (if applicable). The distance for the player formula is

abs(target player.x + 10 - npc.x + (npc.width / 2)) + abs(target player.y + 21 - this.position.Y + (npc.height / 2)) - target player.aggro

The result from that formula is then compared to the guardians formula result:

abs(guardian.x + 25 - npc.x + (npc.width / 2)) + abs(guardian.y + 40 - npc.y + (npc.height / 2)) - 200

Whichever results in the higher value is targeted.

Old One's Army formula[edit | edit source]

Enemies in the Old One's Army follow a separate formula due to having to attack the player, as well as the crystal. An NPC will first determine the distance between the Eternia Crystal and it with a simple distance formula. Then, barring the chance the enemy is currently "ghosted", the NPC determines the "distance" to the player with the following formula.

distance(npc.position, target player.position) - target player.aggro

Even though this formula does account for aggro, a player will be ignored if they are not within 200 pixels of the specified enemy.[1] Like with regular NPCs, if the Guardian is closer to an NPC than the player is, and is within 400 pixels of it, then the Guardian is targeted instead of the player.

Notes[edit | edit source]

  • All Slimes when the Royal Gel is equipped will ignore the player and Stardust Guardian entirely.
  • A Confused enemy will always face away from its target.

Footnotes[edit | edit source]

  1. Betsy, with a slightly different targeting system, will not target the player based on distance, and will instead target the player so long as the player is closest to it in comparison to the Stardust Guardian or Eternia Crystal.

History[edit | edit source]

  • 1.3.4: NPCs can now be targeted.
    • Slimes no longer target the player if the player has Royal Gel equipped.
    • Introduced the Stardust Guardian, which can divert aggro to the player.
  • Pre-Release: Introduced.
Game mechanics
Combat Attack speed • Autoswing • Pc only.png Mobile only.png 3DS logo.svg Combat Targeting • Critical hit • Damage • Knockback • Minions • Velocity
Environment Ambient objects • Day and night cycle • Environment • Event • Map size • Moon • Music • NPC despawning • NPC spawning • Status messages • Pc only.png World Seed
Interface Minimap • Logo • Title messages
Items Consumable • Crafting stations (By Hand) • Crossover content • Explosion-proof objects • Mining speed • Modifiers • NPC drops • Placement • Pickaxe Power • Rarity • Storage • Tooltips • Use time • Value
Game Achievements • Pc only.png Settings (desktop version) Pc only.png Config.json • Pc only.png Camera mode • Data IDs • Difficulty • Pc only.png Expert mode • Game controls • Lighting mode • NPC names
Multiplayer Pc only.png Chat • Multiplayer
Player Aggro • Breath meter • Buffs and Debuffs • Character styles • Death • Defense • Drowning • Fall damage • Ghost • Hairstyles • Health • Health regeneration • Inventory • Mana • Player stats • Spawn