Label ranking of multi-class classification

I have a question about multi-class classification. for the standard regression problem, we have label range from 3.0 to 12.0, then we set some thresholds to cast the regression problem into classification problem: the value between 3.0 to 5.0 we give classification label 0, the value between 5.0 to 6.0 we give classification label 1, the rest can be done in the same manner. It‘s important to notice that it’s not a standard multi-class classification problem, we want the model to output as close as the ground truth label, say that the ground truth label is 4, then it’s not too bad to output 3 or 5 which is close to 4, while it’s too bad to output 0 or 9 which is far from 4. What’s the appropriate methods for this problem?