The bug
Mobs can attack you through blocks and corners due to miscalculation of attack radius.
How to reproduce
Build a completely sealed off house with no windows or doors from opaque blocks like planks or cobblestone or the like, leave some blocks in the inventory for you to place in step 7.
Make a two-block tall one-block wide empty doorway in the wall for you to go through and to seal off with blocks in step 7.
Outside the house, spawn a Ravager.
Switch to survival mode.
The Ravager should start going for you.
Run in the house, let it hit you once through the empty doorway.
Seal off the doorway with two blocks.
Result: The Ravager is still able to hit the player, from about two blocks away, with a complete wall every possible place in between.
Expected: The Ravager can't attack the player any more.
Example
An example can be seen in this comment.
Old example
I just created a villager in MCEdit with the Create Shops filter to have a custom shop. I saved it and launched MC. The villager started to run around normally in his house but then he went to the door where a zombie was knocking at (wooden door on normal difficulty) and the villager blinked red and got damage and after a few hits he died. The zombie killed him through a closed door and the villager did not run away he always came back to the door until he died.
Additional informations
From @unknown:
There are a number of bug reports about attack radius that are all very similar. MC-2310, MC-18326, MC-50668, MC-63965, MC-71834, and MC-74907 are all about the attack radius of mobs extending through blocks. (Some mobs are more bugged than others, but it’s the same basic problem).
There are also a few related issues:
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The problem seems to be the method net.minecraft.entity.ai.EntityAIAttackMelee.checkAndPerformAttack(EntityLivingBase, double)
and methods overriding it. They all only test if the mob to attack is in a certain radius to the attacker without testing if blocks are between them.
Possible solutions
Bounding box check
The current behavior would be replaced by only allowing mobs to attack other mobs when their bounding boxes intersect.
Ray casting
The current behavior would be extended to require a ray cast from the attacker to the mob to attack (excluding liquids and blocks without collision box) to return no colliding blocks. Possible use y + height / 1.5
as attack height or have a method for mobs to define their attack height(s?). The height at which the mob to attack will be attacked could for example be y + height / 2
or with multiple tries depending on the height of the mob, for example
for (int attackFraction = 0; attackFraction < height / 2; attackFraction++) {
double attackHeight = y + height * ((attackFraction + 1.0) / (height / 2.0 + 1.0))
}
Related issues
is duplicated by
relates to
Attachments
Comments


I know I'm not a mod but I think I know the problem. Zombies can't hit mobs but can break doors when they are closed. If the door is open, the zombie can hit mobs but can't break it down. If you place the door sideways, then put it in the open position, zombies can hit mobs (like the villager) through doors. Th other problem might be that Createshops filter was messing it up. If the zombie is making the banging noises than Createshops is the problem. If not it could be either one. I may also be completely wrong.

We're seeing this on naturally generated villages in our vanilla server.

This can sometimes happen to players (tested 1.6.2) and will always occur with baby zombies.

This is a really annoying problem which I hope is fixed soon. Confirmed to still be an issue on Mineraft 1.6.2 with Java 7 update 25 64-bit.

Maybe this issue should be re-opened. I ran some tests in a creative world and it appears that villagers seem to crowd,mostly around the door, in one or several houses at night.
Because the zombies group before the door and then start hitting the villagers through the door somehow, if one villager turns into a zombie, your whole villager population is killed in one sweep.

Reopened? It was never resolved in first place.

This is still an issue in all versions up to and including 14w04a.

Got attacked through an iron door by a Zombie Pigman earlier using snapshot version 14w07a.

This bug is observed in 14w11b.

is this problem being fixed? cause i"m now in snapshot 14w18b and zombies can hit me trough doors.
never had this problem before this snapshot though :S ...
oh and btw: zombies don't break down doors anymore, maybe its related.

This old a bug and none of you noted how it happens? This is old news. If a mob is standing in the block that the door is on ("in the alcove") they can hit through the door. This can be fixed by removing the door and replacing it so the alcove is on the inside of the house. I often go through newly found villages fixing the doors and changing the location of the doorway on the blacksmith (if you add a door in the old location it kills villagers, as they mistake the outside for the inside. The mods here have declared it "not a bug because Mojang doesn't intend players to fix up villages").
Also zombies break down doors on hard only. They half-break the doors on normal and easy (bang on the door causing it to crack but never get further than halfway broken).
Also related: Players can hit baby zombies through the door from the alcove. Only instance I know of where players get to hit through the door. Normally it's only monsters.
EDIT: if the alcove is on the inside and zombies are still getting kills through the door it's probably that other glitch. If multiple villagers are pushing each other and one is in the alcove they can be slightly pushed through the door. It corrects itself (like animals being pushed through fences usually corrects itself) but for a second the villager is vulnerable to hits from zombies outside. I think that's the same way wolves get kills on fenced in sheep.

Only some zombies spawn with the ability to break doors, most of them can't break them.

I can confirm this is still an issue on the 1.8-pre1 release. Zombies are able to kill villagers, as well as players, through any door when close enough to the closed door.

I created a new singe player game, in which a village was close by.
During the night, I heard the "oomph!" sound of a villager being damaged, so I went out of the building and saw a zombie on the outside and villager on the inside. I killed the zombie and went inside with the villager. Another zombie came and as the villager went by the door, it was hurt. I could hear other villagers hurt in another building. I protected my one villager until morning and I went to check on the other villagers.
There were no more villagers, but 6 new 'zombies' were let out of the building the villagers had been in and were promptly killed.
These were all spawned villages and it seems as though normal doors do not prevent villager/zombie damage. Im bummed because I only have 1 villager now.

Using a splash potion of weakness then a regular golden apple should turn a villager zombie back into a normal villager. So instead of killing the zombies, you could have left them for when you got the potions and golden apples and you would have 7 villagers left. This might end up costing far too much gold though.

There are quite a few problems with blocks that don't take up the whole 1m by 1m area. For doors, being attacked by mobs or being shot by an arrow through the door is probably possible because the player or entity's hitbox ends up outside of the door, allowing interaction with it. This has also occasionally happened with regular blocks in a corner where you can see the mob's arm, allowing you to kill a zombie through solid blocks.
PS Zombies will no longer break down doors on any gamemode or difficulty and it is intended to be that way.

Confirmed for 1.8.1-pre1/pre2.

the problem is the hitbox of a zombie.
the hitbox of a zombie (which can be see by pressing F3 + B) can sometimes glitch in the hitbox of a door. however, i do believe this is just a directional glitch.
when the hitbox of a zombie and something it wants to hit collide, the zombie can actually hurt it.

I got killed by a baby zombie going through a IRON DOOR!!!!

Edit: baby zombie bypassing the iron door is for 1.8,1.8.1 now this bug has ben fixed for 1.8.2 and it started after upgradeing from 1.7.10

I also have this problem, my villagers keep dying and I have to block the house entrances with dirt until the morning (damn it...).

http://minecraft.gamepedia.com/Zombie
At "Behavoir" they say zombies are able to deal damage through a closed door.

The Minecraft Wiki isn't considered a reliable source for bug reports. It basically documents the current behavior of the game.

I think this relates to MC-3059 because what is probably happening in both is that the attack IN GENERAL is just going through the door.

Confirmed for 15w33c. It doesn't help that the villagers often press themselves against the door, even if a zombie is trying to break it - _ -

Confirmed for 15w47c

Confirmed for 15w49a

Confirmed for 15w50a

confirmed 16w02a , through closed door and diagonally through corners of blocks and both at same time

This is confirmed for 16w05b, and it's also unfair how the Player is unable to attack through closed doors. My friend created an issue about the Player being unable to attack through closed doors. See MC-96993

Confirmed for 16w06a

Confirmed for 1.9-pre2

Still in 1.9-pre3

Still in 1.9-pre4

Has anyone had the problem in 1.9 where you cover up the door with blocks and the villagers still die? It used to keep them safe, but I lost most of a village yesterday. I guess I'll have to build a whole little room in front of each door until I get the village walled and lit.

Still in 1.9.1-pre1

Still in 1.9.1-pre3

There are a number of bug reports about attack radius that are all very similar. MC-2310, MC-18326, MC-50668, MC-63965, MC-71834, and MC-74907 are all about the attack radius of mobs extending through blocks. (Some mobs are more bugged then others, but it’s the same basic problem). There are also a few related issues:
MC-1297 is the same as the above, but for players.
MC-3059 is the same as the above, but for arrows.
Most or all of these reports should be consolidated into one, as they are all caused by the same base issue.

Confirmed in 1.9.2.
I just died in a new hardcore world because a zombie was able to hit me through the corner of a wall.

Still in 1.10

An arrow can also hit living entities through corners.

Confirmed for 1.10 and 1.10.2.

Confirmed for 1.11.2.

I myself tested and confirmed for 1.9.4, 1.10.2, 1.11.2 both:
adult zombies hit through corners of a (diagonal) wall (sometimes an arm can be seen) and
adult zombies hit through a closed door.
Maybe it's not attack radius but something like hitbox or gaps or solidity of the object(s) between attacker an mob/player. (Seed -5821562820736002727 on 1.11.2 generates a village near the spawn - all villagers die because in the houses they are not safe against zombies.)
For similar description see the duplicates (whose problems are not solved, but there status is "resolved" only because they are duplicates).
My details: I tested with zombies on one side and villagers and player on the other side of a wall. I tested some types of stone and wood - all the same result. Hitting through the door is not affected by the orientation (inside/outside) of the door.
X = block of the wall
D = door (tested in both directions)
Z = zombie
V = villager (same with player)
o = nothing special (monospace did not work here)
oZXZo
ZXVXZ
XVoVX zombies hit villagers
ZXVXZ
oZXZo
ZZZZZZ
ZXXXXZ
ZXVVXZ zombies do not hit villagers
ZXVVXZ
ZXXXXZ
ZZZZZZ
XXXX
XoVDZ zombie hits villager if both near the door
XXXX
(Many villagers were harmed during this test.)

Added a code analysis and possible solutions I could come up with. Feel free to add own solutions as well.

Confirmed for 1.12 Pre Release 2

this bug is apperntly also in mc10 C++/PE as well not sure if i should find a report already or what

MCBC and MCJava have two separate trackers. You can filter by using "project" in the search options. If you find a report there or, if there is none, make one, can you please comment here with the number of it so that it can be linked as related?

Confirmed for 1.12.1. Zombies killed me even though I was boxed into a 1x2x1 hole. Hit diagonally through corners.

Confirmed in 1.12.2

Confirmed for 18w03b 😞

I like the ray cast solution, simple and elegant and the mechanisms are already in place

Confirmed for 1.13.

This potentially is caused by the same issue, as the Drowned attack radius while they are in the swimming animation extends to about 2 blocks away. Only occurs if they are 'horizontal', otherwise attack radius is normal. This becomes very bad if they get in a boat, as they are stuck in swim animation and have a large attack radius.

Can confirm for 18w43c - the zombie hurts the villager and does not attack the door between them.

Confirmed for 18w47b

The villagers can also be damaged through diagonal wall spaces of the new huts usually ther 5x5 ones. appears in 18w50a

Confirmed for 18w50a, the majority of the villages are almost empty because all the villagers are being killed by that.

Still happening in 19w05a

Still in 19w12b

Still in 19w13a

Still in 19w14a

Still in 19w14b and 1.14 Pre-Release 1

Still in 1.14 Pre-Release 2

it still happens in 1.14 Pre-Release 3 and 4

Still in 1.14 pre-5

Still in 1.14 Release

Still in 1.14.1 Release

Still in 1.14.2 Pre-Release 1 and 1.14.2 Pre-Release 2

Still in 1.14.4

Confirmed for 19w42a

Confirmed in 19w45b.

It's very disappointing that this is still a bug 7 YEARS after being reported. I was very hopeful that it would be fixed before 1.15 comes out, but it doesn't look like that's going to happen.


I'm having the same problem in the Nintendo Switch version of this game. Clean through the f[redacted]ing walls, 40 f[redacted]ing levels are gone now. I'll be honest, I expect these types of malfunctions from Bethesda but Mojang really dropped the ball here.

@@unknown, this issue is only for the Java Edition. Please search if this issue has already been reported for Bedrock Edition (MCPE), which includes the Nintendo Switch version, and if not create a new report. Note that there is already MCPE-48401 which sounds similar, but not quite the same.

This bug is extremely conspicuous with ravagers. I'm getting killed (on hard difficulty if I don't have full health) standing 2+ blocks away from a ravager, with a door in between. Its range is bigger than the player's!
Technical difficulties... this ticket will be reopened as soon as Arisa will let us ^^

Ticket has been reopeend

Golems can attack through over 1.5m solid thick walls

@unknown made a comment on MC-147516 that these issues relating to the attack ranges of mobs could be related to this issue.
I attempted to make an individual issue to the bug shown in the video. MC-184710
If you think that this issue does not address the above, you should reopen my issue. Now that it seems this issue might be fixed in 1.16 (It was assigned to Searge 4 hours ago) you might as well get to fixing the issue in the videos as its very similar.

Ravegers are killing me 2 blocks away (me, block block, raveger) inside a building. I am playing on normal difficulty. Even with full iron armor and a shield I am dead in 2 hits and they instantly counter attack when hit. Finally, I can only escape them if I run straight, any deviation they will catch and kill me. This is too much for normal difficulty. I was also killed 23 time because the thing spawn camped me. I literally could not leave my hut. It doesn't help that I also had to deal with a mach 5 evoker spawning vexes like crazy, but that's a different ticket. I did not have this difficulty before 1.16. A raveger with a guy on top will stop to shoot giving me a chance to run at least. I had to use the other pillagers to kill this raveger.

I'm not sure if the villager problem relates to hitboxes but I think if the door was placed incorrectly (on the block next to the doorway) then the villager keeps walking to it (I had it too). I had zombies outside an iron door incorrectly placed and the villager kept running there and died.

Seriously how long does it take to implement three lines of code?
How about stop adding stuff and start fixing stuff?
This bug is game ending. Like quitting playing the game ending.
Look at that Ravenger gif above. How is that fair after all the grinding the player has done to get to that point?
We have to abide by the rules so why can't the rest of MC?
Honestly? Shame on you guys.

Can confirm in 1.17.1

Can confirm in 1.17.1
Ravagers can attack you through a completely sealed off wall if they are still targeting you behind it.
Steps to reproduce:
Build a completely sealed off house with no windows or doors from opaque blocks like planks or cobblestone or the like, leave some blocks in the inventory for you to place in step 7.
Make a two-block tall one-block wide empty doorway in the wall for you to go through and to seal off with blocks in step 7.
Outside the house, spawn a Ravager.
Switch to survival mode.
The Ravager should start going for you.
Run in the house, let it hit you once through the empty doorway.
Seal off the doorway with two blocks.
Result: The Ravager is still able to hit the player, from about two blocks away, with a complete wall every possible place in between.
Expected: The Ravager can't attack the player any more.

Can confirm in 21w39a.

Can confirm 22w17a, 22w16a, and 22w15a.

Can confirm in 1.19.1-pre1
Especially the Ravager can be very annoying due to this bug
I made 2 new small clips to show the issue (One is also with F3 if that helps the devs)
Edit: Apparently my videos don't work on this website (although they are normal mp4), so I uploaded them to Imgur...here is the link

test and confirm in 1.19.1-pre5

Can confirm in 1.19.2

Tested in 1.18 thru 1.19.2
I've noticed that this happens once a mob has already started attacking, not before that. I have a villager zombification/curing station wherein a villager in a minecart is in the corner and a zombie is on the outside of the corner. With the flick of a lever, the blocks on one side of the corner are pulled away, allowing the zombie to attack. If I deactivate the lever and push the zombie back outside BEFORE he attacks the villager, he will go idle, but if I let him attack the villager even one time before pushing him outside, he continues to attack the villager through the corner until the villager is zombified. See attached screenshots: when the wall is open, the villager is being attacked. Even after I close the wall, the zombie continues attacking over and over.

Can confirm in 23w06a

Affects 1.20.1.

OMG NO WAY THEY FINALLY FIXED IT
After almost 11 years, against all odds, someone at Mojang finally fixed one of the most annoying issues in the game.
Whoever is the dev that fixed it: https://imgur.com/a/xFoTlWQ
We need to get this guy a dev of the year award.

In 23w32a

Finally, zombies can't hit you through doors anymore. Good job Gnembon!

Woah, amazing to see this fixed.

Still happens sometimes in 23w33a with spiders.

That's tracked in MC-264915.