It is a humanly reaction to build an easier habit.
wich can be replace by another, with some help .. here is an example.
older generations used to break this habit by putting chili on their nipples.
does not need to be to hot... this will make the child look for a different option.
next time you offer to breast feed. He will remember and not take a chance and refuse it. Or you can always just not give him any and let him get very hungry.
and take his second choice.. ofter a couple days... his adapted to his new habit.