In this paper, we study the modulations of nonlinear transformed waves for a (3 + 1)-dimensional variable-coefficient Kadomtsev–Petviashvili equation in fluids or plasma. By virtue of the phase shift analysis, the shape-changed and unchanged transformed waves are investigated, which shows the inhomogeneity can restrain the time-varying property. The deformation of waves is determined by the phase difference between two wave components. In addition, the evolutions of parabolic transformed waves are illustrated via characteristic lines analysis. The interactions are further explored, which involve the long- and short-lived collisions. In particular, we discuss the dynamics of unidirectional and reciprocating molecular waves based on the velocity resonance condition, including the shape-changed and unchanged atoms. Different from previous results, certain new types of transformed molecular waves with shape-unchanged atoms are discovered. Our results indicate that the inhomogeneity can produce novel transformed waves and further facilitate the modulation of phase transition mechanism.