Paper Plugins
Paper plugins allow developers to take advantage of more modern concepts introduced by Mojang, such as datapacks, to expand the field of what the Paper API is able to introduce.
This is experimental and may be subject to change.
How do I use them?
Similarly to Bukkit plugins, you have to introduce a paper-plugin.yml
file into your jar resources folder.
This can act as a drop in replacement for plugin.yml
, allowing you to specifically target the Paper platform.
It should be noted you still have the ability to include both paper-plugin.yml
and plugin.yml
in the same jar.
Here is an example configuration.
name: Paper-Test-Plugin
version: '1.0'
main: io.papermc.testplugin.TestPlugin
description: Paper Test Plugin
api-version: '1.19'
bootstrapper: io.papermc.testplugin.TestPluginBootstrap
loader: io.papermc.testplugin.TestPluginLoader
Dependency Declaration
Dependency declaration is specified a bit differently than Bukkit plugins, as you are able to define if a dependency is required during bootstrapping. This means that any bootstrapping logic for your dependencies will be run before yours is run.
dependencies:
- name: DependencyName
required: true
bootstrap: true
If a dependency is required
it must be installed on the server or your plugin will fail to load. If marked otherwise, it will
ignore if the dependency isn't found.
Otherwise, your plugin will be loaded fine, in the same fashion as a plugin that is a soft-depend
in a Bukkit plugin.yml
If a dependency is marked as bootstrap
, this indicates that this dependency is required during bootstrapping, which currently does not serve a purpose.
Note that unlike Bukkit plugins, dependencies are independent of the plugin load order. This means that although declaring a dependency will give you access to its classes, if you require it to be initialised before your plugin is loaded, see how to declare load order.
Load Order Declaration
To declare the order in which plugins are loaded before/after your plugin, you are able to define two sections in your paper-plugin.yml
.
It should be noted that the load order for bootstrapping is independent, meaning that if you want to define the load order for bootstrappers
you must set the bootstrap
field to true
.
Note that in certain cases plugins may be able to introduce cyclic loading loops, which will prevent the server from starting. Please read the cyclic loading guide for more information.
load-before
You are able to define a list of plugins that your plugin should load before.
load-before:
- name: PluginName
bootstrap: false
This means that your plugin will load before PluginName
is loaded.