This is a basic Github template to create a working Starsector mod. Under the hood it uses a Gradle automation tool to fetch dependencies and compile source code.
- Have Java SDK installed, anything 7 or above will work
- Pick a mod name (can have spaces, e.g. "My Starsector Mod") and mod identifier (cannot have spaces, only A-z, "mymod", try to make it unique across mod-verse)
- Click "Use this template", use your mod identifier as "Repository name"
- Run
./gradlew build
orgradlew.bat build
(depending on your operating system) - you will get "empty" jar (empty because there is no code yet)
To start creating your mod:
- Create a folder in
src/main/java
with the mod identifier name (e.g.src/main/java/mymod
). - (Optional) Add your mod plugin, recommended would be
src/main/java/mymod/MymodPlugin.java
- this file "lives" inpackage mymod;
and initializes your mod. - Write remaining code.
- Build, package, release.
Already covered in usage, just run ./gradlew build
or gradlew.bat build
.
- Create
src/main/resources/mod_info.json
with correct structure. - (optional) Create additional content in
src/main/resources
:data
andgraphics
folders (if any) with their content,- any other files you want to bundle.
- Run
./gradle release
(mod_info.json
's version will be used)
- Click "Create a release" (either from main page of your repository or from "Releases" tab).
- Name a tag, add title, and add description (optional, usually a list of changes made in this version).
- Add zip file you created in Packaging section and click "Publish release".