C
C#7d ago
Enes Batur

Minecraft Launcher

Hi guys. I'm developing a Minecraft Launcher using Visual Studio. I've sorted out almost everything, but I'm stuck on the most important and hardest part, and I really need your help! When a user clicks the 'Play' button, I need the launcher to automatically install Fabric and download a specific set of mods. Crucially, this needs to happen in my custom .launcher folder, not the standard .minecraft directory, and it must launch Minecraft from there. My intended logic is: every time 'Play' is clicked, it should check for the .launcher folder—if it's missing, create it and install all necessary Fabric and mods. If it exists but the mod files have been changed or are missing, I want it to reinstall the mods folder completely from scratch. Basically, it's a custom server launcher, but I'm totally new to this kind of development and haven't been able to find any guides online on how to implement this. I'd be super grateful if you could help me figure out the logic for this! <3
4 Replies
Buddy
Buddy7d ago
$details
MODiX
MODiX7d ago
When you ask a question, make sure you include as much detail as possible. Such as code, the issue you are facing, what you expect the result to be, what .NET version you are using and what platform/environment (if any) are relevant to your question. Upload code here https://paste.mod.gg/, save, and copy the link into chat for others to see your shared code! (see $code for more information on how to paste your code)
🕊 ILoveBirds 🕊
Install Fabric and download a specific set of mods: look into things like WebClient for downloading
this needs to happen in my custom .launcher folder, not the standard .minecraft directory,: I always used %appdata%/roaming for my game files, you should google something like 'how to change ur minecraft folder directory' and look how its done
it should check for the .launcher folder—if it's missing, create it and install all necessary Fabric and mods. use things like Directory.Exists, File.Exists, Directory.CreateDirectory, Filestream from System.IO namespace for file and folder operations
If it exists but the mod files have been changed or are missing, I want it to reinstall the mods folder completely from scratch. I'm not sure why you wanna reinstall every mod from scratch just because a file is changed or missing, but you can do this by looping through each file in the mod folder, reading the file's content to check if its the same, search something like 'how to check if two files are exactly the same c#' on google, so if its not the same u download and reinstall them again



P.S: try googling more to search 4 things like how to download using c#, how to create or copy files using c#, etc...
Anchy
Anchy6d ago
minor tidbit, use HttpClient instead of WebClient as it is obsolete for some time now

Did you find this page helpful?