Are you irritated of prompts every-now-and-then that ask you to update XYZ mod when you launch minecraft??
Oh yeah, me too.
So I wrote this simple node program that does the job for you. It will download the latest mods in one click.
Easily download the latest mods from Modrinth & CurseForge for specified game version and loader (in my case, fabric).
Now supports separate collection IDs for client and server mods in Modrinth.
Automatically downloads mods into separate folders for client and server environments.
- You need to manually create new collection and assign server mods to that collection.
- Client collection can still be auto updated with
npm run updatebased on followed projects - Defaults to the client collection ID for scripts unless otherwise specified.
"modrinthCollectionId": { "client": "<insert Client-side mods collection ID>", "server": "<insert Server-side mods collection ID>" }
npm run checknow lists the mods sorted alphabetically.- Refactored code to use async await wherever possible.
- Separated the download file logic into its own dedicated module to improve code organization.
- Say goodbye to manual list updates!
- you only need to maintain the public collection from where you want to download the mods.
- no hassle of manually updating the mods list in config file.
"modrinthUserId": "<instert your user id here>", "modrinthCollectionId": "<insert (public) collection id here>",
- After adding userId & CollectionId rename
ModsConfig_example.jsontoModsConfig.json
- After adding userId & CollectionId rename
npm run downloadhope you guessed it, it downloads the mods - if public collection defined in config && collection valid - downloads the mods in the public collection - else - if user id defined in config && valid api key in .env - downloads the mods in the followed projects rest all cases, may the node be with younpm run check- Lists down the available and not available mods for the game version defined in ModsConfig - Some mods might take quite some time to get updated to latest version of MC - helpful if you just want to "check" which mods are available & not available when a new version is dropped eg 1.20.5, 1.21 etcnpm run update[requires api key] updates your public collection from your followed projects (private collection)npm run list- it lists down the mods in the same format as requied in config file so you can download mods via legacy waynpm run legacy- for backwards compatibility
ModsConfig.json is the configuration file:
- It defines game version, loader and list of mods.
- Mod_Name is just a place holder and can be named anything you want.
- Project_ID must be correct. Visit Modrinth to get the project id of the mod.
Add more mods as required. Do not forget to add "," after every "}" when adding a new mods to list. Use below json structure { "Mod_Name": <name>, "Project_ID": <id> }Here is the sample attached - Seprate list maintained for modrinth and Curseforge mods.
{ "gameVersion": "1.20.1", "loader": "fabric", "modsList_Modrinth": [ { "Mod_Name": "Fabric API", "Project_ID": "P7dR8mSH" }, { "Mod_Name": "Sodium", "Project_ID": "AANobbMI" }, { "Mod_Name": "Lithium", "Project_ID": "gvQqBUqZ" } ], "modsList_CurseForge": [ { "Mod_Name": "Litematica", "Project_ID": "308892" } ] }Create a .env file to define your API KEYS.
CurseForge and Modrinth required API KEY.
Modrinth requires api key only for followed mods- if you have public collection, feel free to skip
CF_API_KEY=<api-key> MODRINTH_API_KEY=<api-key>
Run the tool with the configuration file as an argument:
npm run <script_name>The tool will download the latest mod
specified in the ModsConfig.json.directly from your modrinth collection / followed mods.
Ahhh.. coz I am Lazy & didn't want to implement a complex mod manager like system.
This is for those who use only a specifc set of mods and don't need to change it often.
In this case it becomes very easy to manually keep track of required mods.
Other loaders for curseforge
Curseforge is kinda dead now, majority have moved to modrinth
letloaderType=loader==="fabric" ? 4 : 1;
Limited Error Handling
- to avoid over complications in code
- avoid crazy development time
- This is supposed to be a simple quick hack program for downloading mods in 1 command
get follows response from network tab for modrinth followed mods Then use below code to get the array list to avoid manually configuring the list
res=follows.filter(o=>o.project_type==="mod").map(({ id, slug })=>({Mod_Name: slug,Project_ID: id}));
Image for Reference
Suggestions / Contributions are welcome! Feel free to open issues or pull requests for improvements or bug fixes.
This project is licensed under the MIT
- This project utilizes the Modrinth & CurseForge API to retrieve mod information and download links.
