Knockback is a basic mechanism in Terraria, whereby players and enemies are repelled in the opposite direction of an attack. Most weapons and environment objects that cause damage also cause knockback, to varying degrees. Some enemies are immune to knockback, particularly Bosses and other enemies that travel through blocks, like Worms and Man Eaters. Some enemies also have varying degrees of knockback resistance.
The most player-inflicted knockback comes from the Slap Hand, which has a knockback value of 20. This is followed immediately by the Tonbogiri with a knockback value of 13, the Golem Fist with a knockback value of 12, and the Thorns Potion, which retaliates with 10 knockback when its effect triggers.
Knockback is capped at 16 (22.4 if it is a Critical hit). This cap is applied after calculating the enemy's knockback resistance.
Knockback values[edit | edit source]
|≤ 1.5||Extremely weak knockback|
|≤ 3||Very weak knockback|
|≤ 4||Weak knockback|
|≤ 6||Average knockback|
|≤ 7||Strong knockback|
|≤ 9||Very strong knockback|
|≤ 11||Extremely strong knockback|
|> 11||Insane knockback|
Formula[edit | edit source]
First, Calculating knockback resistance:
knockBack = knockBack * (1 - KB Resist)
Then apply cap to it if needed:
if knockBack > 8.0 then knockBack = (knockBack - 8.0) * 0.9 if knockBack > 10.0 then knockBack = (knockBack - 10.0) * 0.8 if knockBack > 12.0 then knockBack = (knockBack - 12.0) * 0.7 if knockBack > 14.0 then knockBack = (knockBack - 14.0) * 0.6 if knockBack > 16.0 then knockBack = 16
Then see if it is a Critical hit:
if isCrit then knockBack = knockBack * 1.4
Then apply knockback to velocity, something like:
velocity = velocity - knockBack
There are some additional detail variations on applying knockback to velocity.
Immune enemies[edit | edit source]
- All Bosses and their minions except Brain of Cthulhu in its second phase, Golem's Fists, and Servant of Cthulhu.
- All Plants except Angry Trapper.
- All Worm AI enemies.
- Ancient Vision
- Blazing Wheel
- Desert Spirit
- Drakin (T2/T3)
- Dungeon Guardian
- Gray Grunt
- Headless Horseman
- Lihzahrd (2nd form)
- Lunatic Devote
- Martian Officer (Bubble Shield)
- Martian Probe
- Martian Walker
- Pirate Captain
- Shadowflame Apparation
- Spike Ball
- The Possessed (On walls)
- Tesla Turret
History[edit | edit source]