Create a new plugin instance.
The identifier of the plugin.
The version of the plugin.
Optional
options: Partial<PluginOptions>The options of the plugin.
Readonly
blocksThe block registry for the plugin.
Readonly
configThe config of the plugin.
Readonly
entitiesThe entity registry for the plugin.
Readonly
identifierThe identifier of the plugin.
Whether or not the plugin is bundled.
Readonly
itemsThe item registry for the plugin.
Readonly
loggerThe logger for the plugin.
The path to the plugin.
The plugin pipeline the plugin is in.
Readonly
priorityThe priority of the plugin.
Readonly
resourcesThe resource packs provided by the plugin.
The serenity instance of the server.
Readonly
versionThe version of the plugin.
The maximum number of listeners for the plugin.
The maximum number of listeners for the plugin.
Check if a file exists in the plugin data directory.
The path to the file to check.
True if the file exists, otherwise false.
Read a file from the plugin data directory.
The path to the file to read.
The file data if it exists, otherwise null.
Write a file to the plugin data directory.
The path to the file to write.
The file data to write.
Introduction
Plugins are the fundamental building blocks of SerenityJS. They are used to add additional functionality to the server, which allows total control over the server.
There are 2 types of plugins that are defined in the
PluginType
enum:Addon
&Api
Addon plugins add additional functionality to the server, without an exposed API. This means external plugins cannot directly interact with the plugins API. Api plugins add additional functionality to the server, with an exposed API for other plugins to use. This means external plugins can directly interact with the plugins API.
Class Extending Plugin