How to change your Game Directory in Minecraft
Changing the game directory for a launcher profile allows you to separate multiple versions of the game or put your game in another disk Do note that even if you change the game directory(for saves, resourcepacks, etc), the main .minecraft folder is used for storing the binaries
Create an empty folder. This is where all the folders for you new installation will go.
Open the Minecraft launcher and click Installations
Find the installation profile you want to have the new directory, click the three dots on right and click Edit
Game Directory click Browse
In the folder Window that opens, find the folder which we created earlier and click Open. Then click Save in the bottom-right.