Skip to content
Public template

About

A template for building PaperMC Minecraft server plugins

Topics

Resources

Code of conduct

Contributing

Stars

78 stars

Watchers

2 watching

Forks

Repository files navigation

PaperMC Minecraft Server Plugin Template

A template for building PaperMC Minecraft server plugins!

This template targets Paper 26.3 and Java 25. For an older server, use the Paper-to-template version table to find the latest compatible template source. Release notes are on GitHub Releases. Spigot and Folia compatibility is not claimed.

Features

Github Actions 🎬

Bots 🤖

  • Probot: Stale
    • Mark issues stale after 30 days
  • Dependabot
    • Update GitHub Actions workflows
    • Update Gradle dependencies

Issue Templates 📋

  • Bug report template
  • Feature request template

Gradle Builds 🏗

  • Shadowed plugin dependencies
  • Checkstyle Google standard style check
  • SpotBugs code analysis

Testing 🧪

  • JUnit 6 unit, integration, and shaded-JAR tests
  • Mockito for mocking dependencies in unit tests
  • Integration tests against real cw-commons

Example Plugin Code 🔌

  • /example command via CommandAPI demonstrating subcommands, tab completion, and permissions
  • Startup config loading and validation via cw-commons' BukkitConfigManagerBuilder, backed by Jackson and Hibernate Validator. The manager closes after loading.
  • CreeperKillListener credits each kill with an atomic PlayerDataManager.update. /example creepersKilled reads the player's SQLite-backed count and reports read failures instead of displaying a misleading zero.

Config Files 📁

  • Sample plugin.yml with autofill name, version, main class, and minimum Paper API version.
  • Example config.yml
  • Gradle build config
  • Simple .gitignore for common Gradle files

Usage

In order to use this template for yourself, there are a few things that you will need to keep in mind.

Building locally

Install Java 25 (and point JAVA_HOME to it) before building.

Thanks to Gradle, building locally is easy no matter what platform you're on. Simply run the following command:

./gradlew build

This build step also runs Checkstyle, SpotBugs, and unit tests.

Run ./gradlew test for isolated unit tests or ./gradlew integrationTest for tests that use real cw-commons configuration and storage implementations. Integration-test files are created in JUnit temporary directories and removed automatically.

Run ./gradlew artifactTest to check the shaded JAR itself: packaged configuration and validation, SQLite persistence, metadata, service providers, and native libraries. It requires no running server.

Dependency and tooling versions live in gradle/libs.versions.toml. Its minecraft version drives both runServer and the processed plugin.yml API declaration; the full paper API pin is kept separately and reused for compilation and all test suites.

JARs can be found in build/libs/.

Contributing

See CONTRIBUTING.md.

About

A template for building PaperMC Minecraft server plugins

Topics

Resources

Code of conduct

Contributing

Stars

78 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages