What are you feeding him? I don't think an environment change would stop him from eating.. I put my dragon in a box outside to feed him crickets (bc I hate having them in my house.. They're escape artists)
So, I'd be concerned that it might be a different issue. There are a few possibilities but I can't say w/out knowing what environment he's in so I'll give u some things to look for.
1-He won't eat bc the food isn't moving, ie: if your trying to switch him to a pre-packed supplemental food.
2-He's impacted. When was the last time he pooped and was it a healthy, semi-solid, log lookin one? Mine went twice a day sometimes but always goes at least once.
3-it's not warm enough in the cage. They need the higher temps to digest the food in their bellies.
I'd make sure the basking spot is at least 100 deg if not a litter higher, I'd try some small crickets, then I'd try a warm
bath to get him too poo. (Google "how to
bathe a dragon" if you haven't given him one b4)
4-He's about to body shed. But when mine shed she just ate less one day, she didn't skip food completely. (A
bath would help this process too)
And if those conditions are all already set id get him to a vet. Let me know how it goes. Got my fingers crossed for u.