Despite the fix of MC-2310, some mobs can still hit you through walls and corners, when they're aggravated. The list of mobs is as follows:
Bee
Iron golem
Panda (aggressive)
Polar bear
Spider
Cave spider
Ravager (might be intended?)
These mobs can still attack you diagonally through blocks or even if there's thin blocks in between, like trapdoors. The rest of mobs like zombies, hoglins and wardens (melee) are unable to attack through blocks as expected.
How to reproduce
Spawn one of the mobs on the list, either inside a box with no outer corners or beside a wall of trapdoors.
Apply slowness if necessary.
Aggravate the mob by letting it see you, then quickly hide on the other side of the wall(s) very close to its hitbox.
Notice you get hit by the mob.
Expected result
These mobs would be unable to hit you through walls/corners, as they're unable to see the player, like how the rest of mobs do.
Observed result
These mobs can still hit you through walls and corners, even if the conditions haven't been met.
Related issues
is duplicated by
relates to
Attachments
Comments


Judging by the duplicates of MC-2310, the list may be incomplete, as i haven't tested dolphins and pufferfish.

Can confirm. Endermen can still hit you through corners.

@unknown, are you sure? i intentionally didn't put endermen on the list because from my testing they weren't affected, you have to make sure the mob doesn't have any way to see you through the wall, in the case of endermen the wall/corner needs to be 3-block tall.

Ravagers are intended per the changelog:
Also, Ravagers won't be able to attack you through a few block thick walls anymore
(Emphasis added by me.) The image attached shows a less-than-single-block thick wall, not a few blocks.
Partial duplicate of MC-264900.

Nevermind, I had MC-264908 so the version was actually 23w32 the whole time...