Try something like this..
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected)
{
if(!world.isRemote && entity instanceof EntityPlayer && ((EntityPlayer) entity).getCurrentEquippedItem() != null)
{
if(((EntityPlayer) entity).isSprinting())
{
this.sprint = true;
System.out.println("aaaa");
}
else
{
this.counter++;
if(this.counter>5)
{
this.counter=0;
this.sprint = false;
}
}
}
}