Snakes are scent driven predators. They eat things that smell like what they are supposed to eat. If they don't find something that smells like what they are looking for, many snakes will starve.
Otherwise, why wouldn't they just eat their substrate or water bowls if they got too hungry?
When you have a snake that simply won't eat, my first response is to make sure it isn't insecure in its cage, second is to check temperatures, and third is to try and figure out what exactly it is looking for.
By way of analogy, I once caught a Desert Phase Cal King on the road in western AZ. The snake was absurdly thin for a 3 foot snake. We couldn't believe it was still alive! It also had some serious scarring to the lower jaw area, but that had healed some time ago.
Out of pity, I kept it. I took it home and put it in a secure cage with plenty of hiding areas. I offered it pinkies and fuzzies, baby snakes, lizards, etc. and it ate nothing.
Finally after a couple of weeks of refusal, I took it out and gave it a good look over. I realized that the injury to the lower jaw had somehow removed the snake's tongue or at least prevented the snake from extending it. The snake wouldn't eat because it couldn't smell food without its tongue. I put it in the freezer to end its suffering. I don't know how long it had been starving itself to death, but I suspect a year or more. All because it couldn't find anything that "smelled" edible.
-----
Chris Harrison