Defense

The defense icon in-game.
Defense is a statistic that determines the change in damage taken per hit. A positive defense stat will reduce the damage taken, while a negative defense stat will increase the damage taken. The damage dealt to an entity will always be at least 1, regardless of defense.[1][a]
The player's defense can be increased by wearing armor and accessories, and temporarily boosted/decreased by various buffs/debuffs. Players always have a positive defense stat; their defense cannot be reduced to below 0.[2]
Non-player entities (enemies, critters, town NPCs, etc.) also have a defense statistic, but it can only be changed by the entity's own mechanics. Some items have the ability of armor penetration, which, in most cases, allows them to ignore some or all of the entity's defense when calculating damage.
Some forms of damage are impossible to reduce through defense, e.g. damage over time from debuffs like Cursed Inferno or damage from drowning in water. Damage taken from lava, however, can be reduced through defense.
Players
Defense gives a flat reduction in damage, i.e. damage is reduced by a fixed amount per hit (as opposed to a multiplicative damage reduction, which reduces damage by a percentage and is applied after defense comes into effect). It is calculated after the general ±15% damage randomization.
The formula is as follows:[3]
[math]\displaystyle{ \text{net damage} = \left\lfloor \text{attack damage} - \text{defense} \cdot f \right\rfloor }[/math]
The factor [math]\displaystyle{ f }[/math] is 0.5 / 0.75 / 1. When calculating damage in PvP, it is always 0.5, regardless of world difficulty.
Examples
Atk. dmg |
Def. | Net damage | ||
---|---|---|---|---|
![]() or ![]() |
![]() |
![]() | ||
40 | 20 | 30 ⌊40 − 20 × 0.5⌋
|
25 ⌊40 − 20 × 0.75⌋
|
20 ⌊40 − 20 × 1⌋
|
40 | 30 | 25 ⌊40 − 30 × 0.5⌋
|
17 ⌊40 − 30 × 0.75⌋
|
10 ⌊40 − 30 × 1⌋
|
75 | 20 | 65 ⌊75 − 20 × 0.5⌋
|
60 ⌊75 − 20 × 0.75⌋
|
55 ⌊75 − 20 × 1⌋
|
75 | 30 | 60 ⌊75 − 30 × 0.5⌋
|
52 ⌊75 − 30 × 0.75⌋
|
45 ⌊75 − 30 × 1⌋
|
Notes
- Defense is more effective in higher difficulties because of the higher factor [math]\displaystyle{ f }[/math] in the formula. However, the damage dealt by enemies is generally higher as well, lessening the benefit. In fact, the increased effectiveness of defense is usually not enough to counter the increased damage, and the player still takes more damage.
- For example, the damage of most enemies in Expert Mode is about twice as high as in Classic Mode, whereas the effectiveness of the player's defense is only 1.5 times as high. As a result, the player will take more than twice as much damage from enemies compared to Classic Mode, given the same amount of defense. For instance, assuming a player with 50 defense (e.g. from wearing Adamantite armor with the helmet) is hit by a Giant Bat:
- In Classic Mode, the Giant Bat's damage of 45 is reduced by 25 and the player takes 20 damage (⌊45 − 50 × 0.5⌋).
- In Expert Mode, the Giant Bat's damage of 90 is reduced by 38 and the player takes 52 damage (⌊90 − 50 × 0.75⌋). This is 2.6 times as much damage as in Classic Mode.
- For example, the damage of most enemies in Expert Mode is about twice as high as in Classic Mode, whereas the effectiveness of the player's defense is only 1.5 times as high. As a result, the player will take more than twice as much damage from enemies compared to Classic Mode, given the same amount of defense. For instance, assuming a player with 50 defense (e.g. from wearing Adamantite armor with the helmet) is hit by a Giant Bat:
Non-player entities
Non-player entities have a defense statistic just like players do, but they do not gain more protection from defense in Expert Mode or Master Mode. They will always change incoming damage by 50% of their defense:
[math]\displaystyle{ \text{net damage} = \left\lfloor \text{attack damage} - \frac{\text{defense}}{2} \right\rfloor }[/math]
Like with players, defense is calculated after the general ±15% damage randomization.
Examples
Target | Net damage | ||
---|---|---|---|
![]() |
![]() | ||
![]() |
Green Slime0 defense | 15 ⌊15 − 0 ÷ 2⌋
|
200 ⌊200 − 0 ÷ 2⌋
|
![]() |
Chaos Elemental30 defense | 1 (0) ⌊15 − 30 ÷ 2⌋
|
185 ⌊200 − 30 ÷ 2⌋
|
![]() |
Paladin50 defense | 1 (−10) ⌊15 − 50 ÷ 2⌋
|
175 ⌊200 − 50 ÷ 2⌋
|
![]() |
Sharkron100 defense | 1 (−35) ⌊15 − 100 ÷ 2⌋
|
150 ⌊200 − 100 ÷ 2⌋
|
![]() |
Eye of Cthulhu (Expert Mode, low health) −30 defense |
30 ⌊15 − (−30) ÷ 2⌋
|
215 ⌊200 − (−30) ÷ 2⌋
|
Boosts
Armor and accessories
A player's defense score can be increased by equipping armor and accessories. Armor usually consists of three items, granting an additional bonus if all pieces match, the set bonus, which may increase the defense score further. Some accessories grant direct defense boosts (see the following table), but all accessories can also be reforged to have defense-increasing modifiers.
See Armor for detailed defense information about every piece of armor.
Item | Accessory defense
|
---|---|
![]() |
1 |
![]() |
1 |
![]() |
1 |
![]() |
2 |
![]() |
2 |
![]() |
3 (only during the night) |
![]() |
3 (only during the night) |
![]() |
4 |
![]() |
4 (only during the night) |
![]() |
4 (only during the day) |
![]() |
4 (during the day) 7 (during the night) |
![]() |
6 |
![]() |
6 |
![]() |
8 |
![]() |
8 |
![]() |
10 |
Modifier | Defense |
---|---|
Hard | 1 |
Guarding | 2 |
Armored | 3 |
Warding | 4 |
Buffs and debuffs
Buffs and debuffs can temporarily alter a player's or an enemy's defense. The defense of enemies cannot be increased, only decreased.
Buff | Buff defense |
---|---|
![]() |
2 |
![]() |
3 |
![]() |
4 |
![]() |
5 |
![]() |
8 |
![]() |
8 |
Debuff | Debuff defense |
---|---|
![]() |
−4 |
![]() |
−4 |
![]() |
−15 (only on players) |
![]() |
−50% |
![]() |
−50% |
Other
These miscellaneous effects increase the player's defense.
Item | Defense |
---|---|
![]() |
4 (permanently) |
![]() |
20 (while guarding) |
![]() |
20 (while guarding) |
Armor penetration
Armor penetration is a hidden player statistic that determines the effective amount of the entity's defense portion that is ignored when dealing damage to it. This stat only works against non-player entities; it has no effect in PvP. It works by increasing the damage dealt as follows:[4]
- If the player's total armor penetration is greater than the enemy's defense and the enemy has positive defense, then the damage is increased by half of the enemy's defense. This means that the entirety of the enemy's defense is effectively ignored (as the enemy's damage reduction by half its defense – see above – is canceled out).
- If the player's total armor penetration is lower than or equal to the enemy's defense (or if the enemy has negative defense), then the damage is increased by half of the armor penetration value. This means that any amount between nearly none and all of the enemy's defense is effectively ignored, depending on the specific values.
See below for examples.
All following armor penetration values are stackable with each other, and all decimals are rounded down in damage calculations.
The following debuffs increase armor penetration when calculating damage towards affected entities:
Debuff | Armor penetration | |
---|---|---|
![]() |
Ichor | 15 |
![]() |
Betsy's Curse | 40 |
The following items grant armor penetration:
Item | Armor penetration
| |
---|---|---|
![]() |
Shark Tooth Necklace | 5 |
![]() |
Stinger Necklace | 5 |
![]() |
Hive Pack | 5 (for Wasp Gun only) |
![]() |
Sharpening Station | 12 (only while holding a melee weapon) |
In addition, the projectiles of certain weapons and accessories have an own armor penetration stat, which is added to the player's armor penetration when inflicting damage upon an enemy with them:[5]
Item | Armor penetration | |
---|---|---|
![]() |
Blade Staff | 25 |
![]() |
Dark Harvest("dark energy") | 50 |
![]() |
Cool Whip(snowflake) | 30 |
![]() |
Light's Bane(slash of darkness) | 5 |
![]() |
Blade of Grass(projectile) | 20 |
![]() |
Muramasa(slash) | 5 |
![]() |
Bone Glove | 25 |
![]() |
Crystal Vile Shard | 10 |
![]() |
Nettle Burst | 10 |
![]() |
Wasp Gun | 10 |
![]() |
Star Cloakand its upgrades | 25 |
![]() |
Arkhalis | 20 |
![]() |
Weather Pain | 10 |
![]() |
Flamethrower | 15 |
![]() |
Elf Melter | 15 |
Examples
Enemy | Player AP |
Increased damage |
Explanation | |
---|---|---|---|---|
![]() |
0 | → | 0 | AP ≤ defense, so increase is AP/2 |
10 | → | 0 | AP > defense, so increase is defense/2 | |
![]() |
0 | → | 0 | AP ≤ defense, so increase is AP/2 (0% of defense ignored) |
10 | → | 5 | AP ≤ defense, so increase is AP/2 (33.33% of defense ignored) | |
40 | → | 15 | AP > defense, so increase is defense/2 (100% of defense ignored) | |
![]() Sharkron100 defense |
5 | → | 2 | AP ≤ defense, so increase is AP/2 (4% of defense ignored) |
10 | → | 5 | AP ≤ defense, so increase is AP/2 (10% of defense ignored) | |
40 | → | 20 | AP ≤ defense, so increase is AP/2 (40% of defense ignored) | |
100 | → | 50 | AP ≤ defense, so increase is AP/2 (100% of defense ignored) (This is a theoretical example, as it is possible but impractical to maintain 100 AP.)
|
Maximum defense
The highest possible defense can be attained using the setups described in the following sections.
Pre-Hardmode
The maximum possible defense is 75 / 77 / 81:
Cobalt Shield
Obsidian Shield
Obsidian Skull
Shackle
- Any accessory or
Shield of Cthulhu(Expert/Master)
- Any accessory(Master)
- Warding modifiers on all accessories
Hardmode
The maximum possible defense is 190 / 200 / 208:
Guarding with the Brand of the Inferno or
Sergeant United Shield
Consuming an Aegis Fruit
See also
History
- Desktop 1.4.4: Non-player entities can now have a negative defense stat. Previously, negative defense would be set to 0.
- Desktop-Release: Introduced.
References
- ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
StrikeNPC()
inTerraria.NPC.cs
,CalculateDamageNPCsTake()
inTerraria.Main.cs
, andCalculateDamagePlayersTake()
inTerraria.Main.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, method
Update()
inTerraria.Player.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, methods
CalculateDamagePlayersTake()
inTerraria.Main.cs
andCalculateDamagePlayersTakeInPVP()
inTerraria.Main.cs
. - ↑ Information taken from the
Desktop 1.4.4.9 source code, method
checkArmorPenetration()
inTerraria.NPC.cs
. - ↑ Information taken from the
Desktop 1.4.2.1 source code, method
Damage()
inTerraria.Projectile.cs
. There may be inaccuracies, as the currentDesktop version is 1.4.4.9.
- ↑ The only exception to this is a player whose multiplayer teammate is wearing a Paladin's Shield. If the player would normally take 1 damage from an attack, but this damage gets split with their shield-wearing teammate, then they will take 0 damage.