Mobs have trouble attacking the player while player is pushed against a wall
When pushed against a wall in a horizontal passageway 1 block wide, the player cannot or can rarely be damaged by projectiles from skeletons. I had noticed this behavior in some other mobs, but wasn't able to recreate it. In the attached image, my character is being bombarded with skeleton arrows but is not losing health.