-
-
Notifications
You must be signed in to change notification settings - Fork 435
Creating Modpacks
Before we go create a modpack from scratch, let's examine the same ones and see how they are structured.
Inside sample-files
, you will find two example modpacks:
- "lightpack"
- "monsterpack"
In the folder for each modpack, you will find:
-
modpack.json
has basic information about the modpack:- "name" is the folder name for the modpack on the client, so it should not contain any funky symbols
- "title" can be anything, however, and it is the name of the modpack shown in the client
- "gameVersion" is a valid Minecraft version
- "launch" -> "flags" is a list of Java flags that will be added by the client
- "userFiles" -> "include" specifies the files that will never be overwritten on update
-
loaders/
contains various installers (NOT -universal versions) of mod loaders, like Forge, LiteLoader, etc. This folder is blank if you have a vanilla modpack. -
src/
is what will go on the user's computer for the modpack.
Updating from an old launcher version? Make sure to remove version.json
because the modpack tool generates it automatically now. If you leave it, the modpack tool will use your version file instead, and you may encounter problems if your file is incorrect.
Because the launcher handles both server and client modpacks, there needs to be a way for you to tell the launcher which ones are server-only and which ones are client-only.
Within src/
, you will find "_CLIENT" and "_SERVER" folders. These can go anywhere and they "disappear" from the final directories. If you put a file in _CLIENT, then the file will only appear on the client; likewise for _SERVER.
In the sample project, you will find a _CLIENT and _SERVER used throughout.
It is possible to place a _CLIENT folder into a _SERVER folder (or vice versa) but this would be pointless and make the file disappear entirely.
If you only plan to make a client modpack, then you don't have to use these folders.
You can make some files optional. For an example of this, browse to sample-files/lightpack/src/mods/_CLIENT
.
Find two files:
CoolGrass.info.json
SomeMinimap.info.json
Inside those files, you will find something like:
{
"feature": {
"name": "SomeMinimap",
"description": "SomeMinimap gives you a cool minimap.",
"recommendation": "starred",
"selected": true
}
}
- "name" is the name of the "feature"
- "description" is a short description that the user can read
- "recommendation" can be omitted, or it can be
starred
oravoid
- "selected" can be
true
to have it selected by default orfalse
to have it unselected by default
How do you name these files? Since the .jar is CoolGrass-1.0.jar
, you can name it:
CoolGrass-1.0.jar.info.json
CoolGrass-1.0.info.json
CoolGrass-1.info.json
CoolGrass.info.json
CoolGra.info.json
CoOlGRa.info.json
As you see, you can simply use the prefix of the file that you want to make optional.
Note: If you want to make optional features that cover several files (in different places), read Optional Features. However, you can't have one feature depend on a second feature at the moment.
If you have some mod that you want to have the launcher download from a custom URL (other than your website), you can create a ".url.txt" file alongside the .jar, as illustrated below.
In the file, you'd put the URL:
You may want to do this if the mod author asks you to redirect downloads to his or her own site, as it may record statistics.
Note: You need to make sure that the .jar that you have is the exact same version as the one at the URL, otherwise the launcher may keep redownloading the file because it thinks the downloaded file has been corrupted since last update.
Create your own folder and create:
-
modpack.json
(copy it from below and change it) -
loaders/
folder -
src/
folder
{
"name": "Light Modpack",
"title": "Light Modpack",
"gameVersion": "1.8",
"launch": {
"flags": [
"-Dfml.ignoreInvalidMinecraftCertificates=true"
]
},
"userFiles": {
"include": [
"options.txt",
"optionsshaders.txt",
"mods/VoxelMods/*"
]
}
}
Put installers (NOT universal versions) into loaders/
and the modpack into src/
.
The easiest way to test and build your modpack is the build tools program that comes with the launcher. You should find this (after compiling the launcher, which you already have done) in build-tools/build/libs
. To use it, copy the "build-tools-X.X.X-SNAPSHOT-all.jar" file to your modpack's folder (the one with modpack.json).
Warning: Java 8+ is required for the GUI.
Double click the .jar to run it, and you should be shown the following interface:
To test your modpack, simply click "Run Modpack." This uses the actual launcher to run the game and will put you in offline mode.
You can click "Test Launcher Options" if you want to adjust memory options for your test instance.
All the files needed to run the test launcher go into a staging/
folder within your modpack folder, which is all temporary and you can delete whenever you don't need them anymore.
If you want to test the modpack as someone who is installing the modpack for the first time, close the test launcher if it's open, click "Delete Instance from Test Launcher," and run the modpack again.
To build the modpack for release, click "Build for Release".
You'll need to choose a version for this release. Every time you push an update, you have to change this value to something else entirely so that the launcher can compare it with the currently installed version to discover the update. By default, the current date and time is filled in for you, which you are free to use.
The manifest filename is for the specific modpack. You can keep this value the same for every update for the same modpack, and the field should already be pre-filled in for you based on the "name" field from modpack.json.
Clicking "Build..." will create the files that you upload to your server. The generated files should appear in a upload/
folder in the same folder as the modpack, although the tool should open a file browser at that directory when it's done to help you find it.
If you are planning to only use the GUI, you can skip this section. Otherwise, this section details how you can build the modpack just using command line tools, which can be more easily integrated into other tools.
- From the
launcher-builder/build/libs/
folder, copylauncher-builder-X.Y.Z-SNAPSHOT-all.jar
to your modpack's folder. - Open terminal or command prompt and navigate to the directory of your modpack.
- Windows users: Hold down your SHIFT key, right click the folder that contains "modpack.json", and click "Open command window here".
- Run the following command (note: put it on one line, and change "X.Y.Z" to the right version):
java -jar launcher-builder-X.Y.Z-SNAPSHOT-all.jar
--version "pick_a_version"
--input .
--output upload
--manifest-dest "upload/your_modpack.json"
- "version" is the version of your modpack and it doesn't have to be a number -- whenever you want to push an update, you have to change the version code to anything else that has never been used before
- "input" is the folder with "loaders," "src," and "modpack.json" --
.
means "the current folder" - "output" is the folder to put the output
- "manifest-dest" is the manifest file that is generated
There should be a upload/
folder now with the generated files.
Upload the contents of upload/
to your website to the same place that you uploaded sample-files/upload/
(merging "objects" and "libraries").
Warning: If you are using FTP to upload, remember to switch your client to "binary mode."
If you have previously uploaded the modpack, you can skip existing files.
The package listing file links to the modpacks available.
- If you are using the PHP version (
packages.php
), then you don't have to do anything. Skip this section. - If you are using the .json version (
packages.json
), you manually have to update it.
To update it, add you modpack to the list, possibly removing the others:
{
"minimumVersion": 1,
"packages": [
{
"name": "Your Modpack",
"title": "Light Modpack",
"version": "pick_a_version",
"location": "your_modpack.json",
"priority": 1
}
]
}
Run the launcher (the -all.jar
in launcher/build/libs
) and see if your newly created modpack works.
To do updates:
- Build the modpack (as in run the program) the same way that you did above.
- Upload changed files from
upload/
. You do not need to worry about conflicts. - If you are not using the automatic PHP version: change the version of the modpack in
package.json
.
Warning: If you use something like CloudFlare, it will cache files so your new version will not take effect. You may have to purge the cache.
Tip: For more permanent installations, you can make it all automatic by using a continuous integration server like Jenkins or TeamCity.
If you have multiple modpacks, you still upload everything to the same folder, merging "objects" and "libraries". Just make sure that the package listing file lists all the modpacks.
You can see this in the sample project: sample-files/upload/
contains files for both light and monster modpacks and package.json
links to both.
At this point,
- You may want to replace all the images in
launcher/src/main/resources/com/skcraft/launcher/
if you have not done so yet. - You may want to change the name of the launcher in
launcher/src/main/resources/com/skcraft/launcher/lang/Launcher.properties
if you have not done so yet.
You can now release the launcher (the -all.jar
in launcher/build/libs
), but you may want to use the bootstrapper instead which can handle self-updating of the launcher. See Configuring-Self-Update.
Need help? See Getting Help.
Tutorial
Launcher Features:
- Fancy Launcher
- Portable Mode
- Hidden Modpacks
- Deploying Server Modpacks
- Launcher Arguments
- Custom JAR (.jar mods)
- Custom Version Manifest
Customization:
- Localization
- News Page Guide
- Custom Microsoft OAuth application
- Using an IDE (Eclipse, IntelliJ)
Additional Reading:
Find the launcher useful?
Donate to obw, the current maintainer:
Donate to sk89q, the original maintainer: