Opinionated template/starter for creating Minecraft plugins in Kotlin using the Spigot API
- Gradle axion-release-plugin for managing semver
- automatic updating of
CHANGELOG.md
andmain/resources/plugin.yml
when a release is made
- automatic updating of
- Github Actions to build PRs and automatically create Github releases when a release tag is pushed
- Manual Create Version pipeline to increment semver tag and trigger publishing a new version
- Requires a configured deploy key with write permission to the repository (see usage below)
- Manual Create Version pipeline to increment semver tag and trigger publishing a new version
ktlint
Gradle plugin- Gradle build generates a standard plugin jar which will download dependencies declared as
libraries
inplugin.yml
and an "offline"/shadowed jar containing necessary dependencies
- Use the template to create a new repository: Create a new repository
- Change template repository references
settings.gradle.kts
-> setrootProject.name
gradle.properties
-> setrepoRef
build.gradle.kts
-> setgroup
CHANGELOG.md
-> update links toSimpleMC/mc-kotlin-plugin-template
to matchrepoRef
src/main/resources/plugin.yml
-> setname
,main
,website
,author
src/main/kotlin/org/simplemc/plugintemplate/KotlinPluginTemplate.kt
-> Move packages/rename for your pluginREADME.md
-> Update
- To use the Create Version automation, add an SSH key
- Create an SSH key-pair (no password):
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/<name_your_key>deploy
- Add the Public Key as a Deploy Key (Important! Enable
Allow write access
): https://docs.github.com/en/authentication/connecting-to-github-with-ssh/managing-deploy-keys#set-up-deploy-keys an Actions secret to your new repository:https://github.com/<repo slug>/settings/secrets/actions/new
- Add the Private Key as an Actions secret:
https://github.com/<repo slug>/settings/secrets/actions/new
- Name:
COMMIT_KEY
- Secret Contents: Paste the Private key
- Name:
- The GitHub Actions are configured to use this key to publish tags and release commits (see
.github/workflows/create-version.yml
)- See axion-release-plugin Authorization for alternative Auth options
- Create an SSH key-pair (no password):
Several SimpleMC plugins are built off of this template or were the impetus for it:
- SimpleNPCs - Simple command-based NPC interactions
- SimpleHealthbars2 - Simple, easy-to-use healthbar plugin with optional player and mob healthbars
- SimpleAnnounce - SimpleAnnounce is a simple and easy to use, yet powerful automated announcement plugin for the Bukkit Minecraft API.