You can become invulnerable to all knockback by following these steps:
1) Create a superflat creative world in Minecraft 1.9 Pre-Release 4
2) Run this: /tp @a -415 4 1465
3) Run this: /tp @a -798 4 1231
4) Go into survival mode and summon in all the monsters you want - you no longer take knockback until you die or reload the world.
Don't ask me how it works, those teleport commands magically make the player invincible to knockback.
Linked issues
Comments 11
Wow, I can reproduce this. My damage-taking sound goes away, and enemies no longer give knockback from attacks (though they do push me with collision and cause damage as normal).
My mistake, Brian is definitely right.
EDIT: I've also misunderstood this entirely, I thought this was talking about damage in general, not just knockback. Apologies.
I could reproduce it.
Here is what I got so far:
1. @a is not needed (was to expect)
2. y-coodinate doesn't matter it seems
3. It doesn't work with all coordinates
4. The two coordinates used in the bug post are in different region files.
My guess is that when teleporting to a different region (or section or chunk or something like that) the player entity is removed from some list for one region and added to one of an other region. Under certain conditions (as in the bug post) that fails (maybe just for the client or just for the server and not both) and causes some check or update to fail for knock back.
To narrow the cause down we should try to find out what properties the coordinates of the teleport commands for which this happens have in common. (Also the initial position might matter)
This tool might be helpful when trying around with different coordinates:
https://dinnerbone.com/minecraft/tools/coordinates/
Well, it's not as simple as 'into unloaded chunks', as I've tried using /spreadplayers on a Pig to load the chunk before (or simultaneously) teleporting there, and that has no affect. However teleporting back into previously-loaded chunks does have an effect, e.g. if you do "tp ~ ~ ~300", then "tp ~ ~ ~-300" (back to start), then "tp ~ ~ ~600", the bug does not repro. This is regardless of whether the player starts/spawns in spawnchunks or not. I guess a future test to narrow it down might be to try multiplayer...
Interesting. Teleporting P1 300 blocks away, and then 300 blocks further, P1 experiences the bug, but then having P2 start at the same location and twice similarly teleport, P2 does not experience the bug. And if I tp P1, then P2, then P2, then P1, neither gets the bug. Also true for longer sequences, e.g. P1, P2, P2, P1, P1, P2, where each teleports relatively 300 blocks. So it seems like if one player has already loaded chunks for the other, then it breaks up the 'twice consecutively teleported to non-player-inhabited chunks', maybe? So I guess my current hypothesis is that a player who is teleported into chunks not already loaded by a player, and then is teleported again into chunks not already loaded by a player (with no intervening teleports into any chunks previously inhabited by a player), will cause the bug? This is really hard to black-box test; looking at the code would potentially help a lot.
dupe of MC-92916 ? may need to add to description there, haven't checked
This bug report can be closed as it relates to MC-92916
Was already listed in MC-92916.
Cannot confirm [for 1.9-pre4]. I've had some mobs not be able to damage me randomly, but this seems to be them just not attacking.