This is a base plugin project written in Kotlin using Gradle for dependency management. It's ready for you to clone/fork it and implement your own plugin!
We would include our entire plugin api library if we could, but it's simply not complete enough yet. Would just lead to it being a huge pain in the ass to maintain your plugin at that point.
While this is written in Kotlin, you can safely use Java if you want to. There is an example command written in Java with the existing code. It's quite ugly, so if you want to primarily write Java, it's advisable to remove the Kotlin code and use it as a reference for a Java version.
- Command API library that will help you create commands easily, without having to register them in
plugin.yml.- Disclaimer! The command API-library is not very mature, and you should be cautious about using it if you intend to install plugins on a public server.
- If you have a preferred command implementation API already, just delete the
commands-package entirely. - Known Issue! When at last argument of a command, it might still give some suggestions, some that are incorrect.
- Uses Spigradle, which will handle:
- Base project itself actually compiles and runs on a server if you want to see how it works out of the box.
- Basic management commands for plugin's config.yml. These commands can update values from in game, as well as saving them to the config.yml again. Sure enough saving does create a backup of the old config.
- These should also provide some "real-life" examples of how commands can be implemented in this system.
Disclaimer! You don't really need to read any of these points if you're already have experience with setting up Java or Kotlin projects.
To set up this project, simply clone or fork the repository, then apply your changes. Suggest you start with these:
- Change the name found in settings.gradle.kts to whatever you want it to be. (Won't matter for the plugin itself, just your sanity while developing it)
- Update build.gradle.kts:
- Should change the group path to match your updated package structure.
- Should also remember when you add or remove dependencies that it's a good idea to pay attention to the libraries section for the spigot.yml generator config.
- Change the values in gradle.properties to match what you need for your plugin.
- Remove the code you don't need.
- Create a Git repository, GitHub is free to use, even for private repositories
- Change the package structure to match what you need. If you have a domain, typically in reverse followed by project name