Knockback
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 player can become immune to knockback by equipping the Cobalt Shield, Paladin's Shield, or any of their upgrades, or by grappling on any surface using any hook. Wearing the full Gladiator armor(Desktop, Console and Mobile versions) set also grants the player knockback immunity.
Player-inflicted knockback can be increased by various modifiers, the Titan Glove accessory and its upgrades, the Titan Potion, and the Shroomite and Vortex armors'(Desktop, Console and Mobile versions) stealth effects. Critical hits increase the inflicted knockback by 40%. Enemies that are afflicted with Cursed Inferno receive 10% more knockback.
Player knockback
When the player receives damage from most sources without knockback immunity, their velocity will be instantaneously set to 18 mph up and 23 mph away from the damage source. Ogre will deal increased knockback with his club swing attack, however, and this will even deal knockback to players that have knockback immunity — 38 mph up and 54 mph away, or 8 mph up and 13 mph away with knockback immunity.
The direction the player is knocked back in depends on the side the player is hit on, not the movement direction of the enemy or projectile. Lasers can knock the player towards the enemy that fired them, for instance, or a bat moving to the left can knock the player to the right, if the player was hit on the left.
When dealing with knockback, the main goal is to get to safety and avoid getting stunlocked. Shooting out a hook can provide temporary knockback immunity to get out of a stunlock, but otherwise it's best to move along with the knockback, up and away from the enemy. Moving against the knockback is much more difficult; falling through knockback will cause the player to take several hits in the meantime, and passing through an enemy horizontally requires heavy movement speed buffs like from a Panic Necklace.
Knockback values
The knockback inflicted by an item is usually displayed in its tooltip. The exact values are not displayed, they are grouped into the following categories instead:
Value | In-game text |
---|---|
0 | No knockback |
≤ 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
The following steps are taken when an enemy is struck with a weapon that inflicts knockback.[1]
First, calculating knockback resistance:
knockBack = knockBack * (1 - enemyKnockbackResist)
Then multiplying knockback by 110% if the target is suffering from Cursed Inferno:
if cursedInferno then knockBack = knockBack * 1.1
Then applying cap to it if needed:[2]
if knockBack > 8.0 then knockBack = 8 + (knockBack - 8.0) * 0.9 if knockBack > 10.0 then knockBack = 10 + (knockBack - 10.0) * 0.8 if knockBack > 12.0 then knockBack = 12 + (knockBack - 12.0) * 0.7 if knockBack > 14.0 then knockBack = 14 + (knockBack - 14.0) * 0.6 if knockBack > 16.0 then knockBack = 16
Then multiplying knockback by 140% if it is a critical hit:
if isCrit then knockBack = knockBack * 1.4
There are two cases from here, depending on how the damage of the attack compares to the enemy's max HP. If the hit deals over 1/10th / 1/15th of the enemy's maximum health in damage, including damage variation, defense, and critical hits, it will deal much more knockback.
- If the hit damage is above the threshold, 2 * knockback is added to the target's horizontal velocity, up to a total limit of knockback in the direction of the knockback.
- If the hit damage is below the threshold, the target's horizontal velocity is set to knockback * (1 - enemyKnockbackResist). This means that knockback resistance is double counted for weaker hits.
The vertical component for knockback follows the same cases as above, with a further multiplier — 0.5x for floating enemies, 0.75x for non-floating enemies. Snow Flinxes hit by a strong hit specifically get an additional 1.5x multiplier to vertical knockback.
Against enemies with low knockback resistance, weak and strong hits will perform similarly; however, as knockback resistance increases as the player progresses through the game, strong hits become more and more relevant for landing meaningful knockback.
The direction of knockback against enemies depends on the attack. Melee swing hits will always send the target in the direction the player faces, while most projectiles will send enemies in the direction the projectile is facing, not where the projectile hits the enemy. Some projectiles instead always knock the enemy away from the player, most visible with swords like Excalibur which hit enemies equally on both sides.
Immune enemies
- Most bosses and their minions.
- The exceptions are Brain of Cthulhu and its Creepers, Servant of Cthulhu, the Hungry, Probes, Plantera's Tentacles, and (Old-gen console and 3DS versions) Golem's Fists.
- Brain of Cthulhu, Creepers, and Hungry all receive exponentially increasing knockback resistance in expert multiplayer, making them dramatically more difficult to knock away. Brain of Cthulhu and Creepers become completely knockback immune with enough players. HP increases in multiplayer can also prevent weapons from landing strong hits, leading to weaker knockback scaling and more effective knockback resistance.
- The exceptions are Brain of Cthulhu and its Creepers, Servant of Cthulhu, the Hungry, Probes, Plantera's Tentacles, and (Old-gen console and 3DS versions) Golem's Fists.
- All plants except Angry Trapper and Clinger.
- All Worm AI enemies.
Other:
- Ancient Vision
- Antlion
- Blazing Wheel
- Desert Spirit
- Drakin (T2/T3)
- Dungeon Guardian
- Gray Grunt
- Headless Horseman
- Lihzahrd (second form)
- Lunatic Devotee
- Martian Officer (Bubble Shield)
- Martian Probe
- Martian Walker
- Paladin
- Pirate Captain
- Shadowflame Apparation
- Spike Ball
- Sroller
- The Possessed (on walls)
- Tesla Turret
- Wandering Eye Fish
- Yeti
- Zombie Merman
Some enemies can also become immune to knockback in specific scenarios. For instance, Biome Mimics are vulnerable to knockback while grounded, but immune to knockback while airborne for any reason.
Weapons inflicting the most knockback
The Slap Hand has the highest listed base knockback value (20), followed by the Shadow Jousting Lance(Desktop, Console and Mobile versions) (14), Hallowed Jousting Lance(Desktop, Console and Mobile versions) (13), Jousting Lance(Desktop, Console and Mobile versions) (12), Golem Fist (12), Morning Star(Desktop, Console and Mobile versions) (11), Celebration Mk2(Desktop, Console and Mobile versions) (10), and the Thorns Potion, which retaliates with 10 knockback when its effect triggers.
The Jousting Lances have the potential to inflict even more knockback, though, as their knockback depends on the player's speed.
The weapons with the potential for the highest knockback in the game are the Gray and Orange Zapinator. Their laser beams have a chance to multiply their knockback by 9 upon hitting an enemy. With the base knockback of 6, they can achieve knockback values of 54 after one hit (1/20 (5%) chance), 486 after two subsequent hits (1/400 (0.25%) chance), etc. The highest possible knockback value of a laser beam (with unmodified base knockback) is 28,697,814, achieved after seven hits where knockback is increased (the beam disappears after the eighth hit). However, the odds of this are incredibly low at 1 in 1,280,000,000.
The listed base knockback values of all weapons can be seen at the list of weapons. Remember that knockback is capped at 16 (22.4 for critical hits), after calculating the enemy's knockback resistance.
References
- ↑ Information taken from the
Desktop 1.4.3.6 source code, method
StrikeNPC()
inTerraria.NPC.cs
. There may be inaccuracies, as the currentDesktop version is 1.4.4.9.
- ↑ This is written properly, it follows the steps in order so that a Slap Hand against a target that is not alight with Cursed Inferno and does not critically hit ends up at 14.9168 knockback, having been reduced 4 times, barring other enemy-specific modifiers.