If you have to ask if the heat lamp is "too close" then that makes me about 99% certain that IS the problem and you have a very serious burn to deal with.
These are hardy snakes, and they can survive such an injury....but without some competent vet care, the chances of survival are small. The risk of infection is high...and an infection from a wound like that would almost certainly be fatal without medical intervention.
The very FIRST thing you have to do is get that heat lamp out of there and away from the snake. Study our care sheet and figure out how to make the enclosure both safe and secure, as well as sterile. No loose bedding that can get stuck on the wound....clean paper only.
And then figure out a way to see a vet.![]()