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.
Equipping any Shield (with the exception of the Shield of Cthulhu and the Squire's Shield) grants the player knockback immunity. Grappling on any surface using any Hook will also grant the player knockback immunity. Wearing the full Gladiator armor set (dropped by Hoplites found in Marble Caves) also gives the set bonus of knockback immunity.
The most player-caused/inflicted knockback comes from the Slap Hand, which has a knockback value of 20. This is followed immediately by the Shadow Jousting Lance with a knockback value of 14, then by the Hallowed Jousting Lance and Tonbogiri with a knockback value of 13, the regular Jousting Lance and 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.
Various modifiers, and the Titan Glove accessory and its upgrades, can increase player-inflicted knockback. __NOTOC__
== Knockback values ==
Value 	In-Game Text
0 	No knockback
0.1 to 1.5	Extremely weak knockback
1.6 to 3 	Very weak knockback
3.1 to 4 	Weak knockback
4.1 to 6 	Average knockback
6.1 to 7 	Strong knockback
7.1 to 9 	Very strong knockback
9.1 to 11 	Extremely strong knockback
Above 11 	Insane knockback
== Formula ==
First, calculating knockback resistance:
 knockBack = knockBack * (1 - KB Resist)
Then multiplying knockback by 110% if the target is suffering from Cursed Inferno:
 if onFire2 then knockBack = knockBack * 1.1
Then apply cap to it if needed: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 doesn't crit ends up at 14.9168 knockback, having been reduced 4 times, barring other enemy specific modifiers.
 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 see if it is a Critical hit:
 if isCrit then knockBack = knockBack * 1.4
Then apply knockback to velocity, with differing multipliers depending on whether the hit is more than 10% of the targets max health (15% in expert mode), and 1.5x as much vertical velocity if the target is a Snow Flinx. There are additional changes based on whether the enemy has the noGravity flag set.
== Immune enemies ==
* 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 and Clinger.
* All Worm AI enemies.
Other:
* Ancient Vision
* Antlion
* Blazing Wheel
* Desert Spirit
* Drakin (T2/T3)
* Dungeon Guardian
* Gray Grunt
* Headless Horseman
*Hemogoblin Shark
* Lihzahrd (2nd form)
* Lunatic Devote
* 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
== History ==