It may be all in your mind, but brain scans suggest the effects are real.
Source: Has Hypnosis Finally Been Vindicated by Neuroscience?
This link will take you to a well-written summary of neuroscience research that illustrates how the brain responds to the experience of hypnosis. From New York Magazine, Nov. 21, 2016