Minecraft wiki entry for Damage, associated text: After sustaining damage from any source, a mob/player turns red for half a second. During this period, it is immune to most kinds of further damage. For instance, if the player attacks a mob by repeatedly hitting the attack button, attacks that land while the mob is immune deal no damage (and don't reduce the durability of a melee weapon).