Addon Configuration¶
build.gradle.kts¶
Now that you've created your project, you need to set several values in the addon extension. If you're using the addon template, most of these values are already set for you.
Options marked with a * are required.
name*¶
This is the name of your addon. Names may only contain alphanumeric characters, periods, underscores, and hyphens ([A-Za-z0-9._-]+).
The lowercase version of this name is used as your addon's id. Your items and blocks are linked to this id, so you cannot change it later, without breaking existing worlds.
Example:
In most cases, you can just use your project name:
version*¶
The version of the addon.
Example:
Or to automatically get the version from your project:
main*¶
Full path to your addon main class (without the .class extension).
Example:
dependency¶
You can declare dependencies on other plugins / addons using dependency:
Example:
The following creates a dependency in both BOOTSTRAP and SERVER phase on the given plugin:
(If you're depending on a Nova addon, do this)
For plugins that don't have a bootstrapper, you can instead specify the phase:
pluginMain¶
Full path to your plugin main class (without the .class extension).
If you don't define this property, Nova will generate a plugin main class for you. You will be able to access your plugin instance via your addon object.
Example:
loader¶
A custom plugin loader. Defining a custom plugin loader will disable Nova's library loading mechanism that can be accessed via the libraryLoader dependency configuration.
Example:
bootstrapper¶
A custom bootstrapper.
Example:
description¶
A description of your addon.
Example:
authors¶
A list of author(s) of your addon.
Example:
contributors¶
A list of contributors to your addon.
Example:
Or for multiple authors:
website¶
A website for your addon.
Example:
prefix¶
The prefix used in log messages.
Example:
Example configuration¶
addon {
name = "ExampleAddon"
version = "0.1"
main = "com.example.ExampleAddon"
authors = listOf("Example Author", "Another Author")
dependency("machines")
}
Project Distributors¶
To set up update notifications, simply override the projectDistributors list in your addon object:
object MyAddon : Addon() {
override val projectDistributors = listOf(/*your distributors*/)
}
By default, there are three different distributors available:
| Distributor | Code |
|---|---|
| Hangar | ProjectDistributor.hangar(/*project id*/) |
| Modrinth | ProjectDistributor.modrinth(/*project id*/) |
| GitHub | ProjectDistributor.github(/*project id*/) |
You can also create your own distributor by implementing the ProjectDistributor interface.
Order of update checks
When checking for updates, all registered distributors are checked in the order they are specified in the list.
This means that if you want users to download your updates from a specific distributor, you should put it at the top of the list.
Pre-release versions
Users will only be notified of pre-release versions if they themselves are using a pre-release version.