A starter template for building Minecraft plugins targeting the Paper server using Gradle.
- Paper API 1.21.4 — configured as a
compileOnlydependency - Shadow JAR — produces a single fat JAR via Gradle Shadow
- Java 21 toolchain — enforced via Gradle, no manual JDK management
- Version injection —
plugin.ymlversion is set automatically frombuild.gradle - Local server support — place
paper.jarinrun/to enablecopyToServerand IDE run configs - GitHub Actions CI — builds on push/PR, creates GitHub Releases on
v*tags
- Java 21+
- Gradle 9.2+ (included via wrapper)
- Click Use this template on GitHub (or clone the repo).
- Update the placeholder names (see Customization below).
- Build the plugin:
./gradlew buildOn Windows PowerShell:
.\gradlew.bat buildThe plugin JAR will be in build/libs/.
To automatically copy the built JAR into a local Paper server:
- Place your
paper.jarin therun/directory (or pass-Pmc_server_jar=/path/to/paper.jar). - Run:
./gradlew copyToServerThe build will also generate IDE run configurations (IntelliJ / VS Code) when the server JAR is detected.
| Task | Description |
|---|---|
build |
Compile + Shadow JAR |
shadowJar |
Produce the shaded plugin JAR |
test |
Run unit tests |
copyToServer |
Copy the JAR to run/plugins/ (requires server JAR) |
generateVSCodeLaunch |
Generate .vscode/launch.json for the Paper server |
copyDependencies |
Copy compile classpath to build/dependencies/ |
Before using in production, update:
groupandversioninbuild.gradlerootProject.nameinsettings.gradle- Package path under
src/main/java/ name,main,author, anddescriptioninsrc/main/resources/plugin.yml
The included GitHub Actions workflow (.github/workflows/build.yml):
- Builds and tests on pushes to
main/developand on pull requests - Creates a GitHub Release with the plugin JAR when you push a
v*tag:
git tag v1.0.0
git push origin v1.0.0