Zombies and some other mobs (slimes, silverfish, endermites...) sometimes don't succeed in hitting you if you aren't in the middle of a block. Instead they will try to hit the middle of the block.
Steps to reproduce:
Create a superflat world with cheats enabled
Run the command
/tp @p 0 ~ 0.9
Run the command
/gamerule doMobSpawning false
Run the command
/time set night
Run the command
/summon Zombie ~ ~ ~-5
This does not always seem to work, tough.
Or an easier method:
Place down a wall an walk as close to it as you can
Spawn a zombie in front of you and note how it doesn't succeed in hitting you
EDIT:
Now mostly happens with baby zombies. Also see @unknown's comment.
Code analysis by @unknown can be found in this comment.
Linked issues
is duplicated by 19
relates to 3
Attachments
Comments 21
I've done some research, and it seems the problem is that Zombies are acting as if the Player is at the center of whatever block they are on. To easily reproduce:
1. Start a Creative Superflat world
2. Run the command /tp @p 0 ~ 0.9
3. Run the command /gamemode s
4. Run the command /summon Zombie ~ ~ ~-5
The Zombie will walk up and start attacking the center of the block you are on, while you sit safely on the far side. I suspect that this bug has something to do with Dinnerbone's changes to Player packets, but it could be something else.
May I ask why you changed the "steps to reproduce" so that the Player would be closer to the center of the block, and then added that it didn't always work? I had 100% success at reproducing it with the /tp coordinates set to 0 ~ 0.9, which is as far from the center of the block as the Player will go with one digit. If you increased it to 0.999 or otherwise changed the setup I would understand, but it looks like you just chose a random coordinate with less chance of working and said, "This doesn't always work," and I'm just a bit confused as to why.
@Sol Toder For me it seemed to work more often this way, but maybe I was mistaken. I will change it back.
The Steps to reproduce don't seem to work in 18w31a. The Zombie certainly does damage. Even when the player stands against the wall, the zombie is able to hit, just not as fast as in an open area. A subject to interpretation if this Issue can be closed.
@unknown Not that it matters too much but as this was a real issue Fixed would be a more accurate resolution in this case, right? Or are we not sure this is fixed yet?
[^Minecraft 15w41b =7_10_2015= 17_31_43 [PM].mp4]
[media]