The bug
Ever since the beginning of 1.14 snapshots, mobs wouldn't get knocked back when a player is blocking with a shield.
Here are some screenshots from the current version (1.13.2) and current snapshot (19w14b)
1.13.2:
Vindicators
Piglin (New Mob in 1.16.x)
Zombie Pigman/Zombified Piglin (renamed in 1.16.x)
Zombie Villager
Zombie
Husk
Drowned
Wolf
Wither Skeleton
Enderman
Spider & Cave Spider
Silverfish
Slime and Magma Cube
These mobs do knockback when you're blocking.
19w14a & b and beyond of 1.14 - 1.16:
The mobs I said above don't do knockback in the current version(s).
However, this doesn't affect to Creeper/TNT explosions, as you still do knockback from it. And arrows from Skeletons/Strays will still bounce of the shield.
Code analysis
Code analysis by @unknown & @unknown can be found in this comment and this comment.
Linked issues
is duplicated by 5
relates to 3
Attachments
Comments 46
Still in 26.1 snapshot 7.
This mod can fix this bug. https://modrinth.com/mod/shieldsknockback/versions
If developer wants to remove the shield-knockback, why not add components for players to choose? It’s a really bad idea to transfer the knockback to the blocker and stopped by the shield-blocking-damage-tick.
Still in 26.2-snapshot-8.
This knockback gets applied into the player itself. Try to block the laser of a guardian, then player get a strange knockback towards the guardian.
in net\minecraft\world\entity\LivingEntity.class, protected void blockedByItem():
This is the origin code that cause the wrong knockback:
According to the comments below, change the order defender.getX/Z() and this.getX/Z().
Shield absolutely has no reason to launch defender forward, like that in MC-182638(Relates to).
If this is used to reduce defender knockback, what’s wrong with Mojang to forget adding defender.hurtMarked True after defender.knockback(…)?
I’m not sure whether shield repels attacker on Java 1.9-1.13 is a designed feature. However, it was changed to defender in order to reduce knockback in 1.14 (Plausible?).
After 26.3, Mojangn add “fullyBlocked“ to fix MC182638.
But I think Mojang should add another line to fix MC147694 like this. And this doesn’t affect player because without “huetMarked” player will not receive knockback from shield.
Still confirmed for 1.14 Pre-release 1