Why does my minecraft sprint stop when hitting an entity?

Solution 1:

That is normal game operation. A quote from the wiki on sprinting:

Sprinting ends when the player collides with a solid block, sneaks, blocks or attacks a mob.