- Follow the "API Getting Started" guide and install the API into your classpath.
- An understanding of the Java programming language is necessary.
- A test plugin has been created in the GoMint repository and can be browsed here for another example of what we will be creating.
Before you begin writing a plugin, you will need a
pom.xml for the plugin. It is pertinent that this file be included.
Step One - The
All plugins for the GoMint server contain a class extending
where the initialization and cleanup of the plugin will take place, as well as the
registration of event handlers, new logic, etc. In lieu of a
main() method, the plugin management system handles the initialization of plugins, so it is important that the annotations and types are setup correctly.
Rather than use a configuration file that is packed into the JAR file to describe the organization of the plugin, GoMint utilizes annotations in the
Plugin type for your plugin. These allow you to set parameters and descriptive elements for your plugin and are required for your plugin to load correctly.
|PluginName||String||Your plugin's name|
Plugin Available Methods#
The following methods are inherited from
Plugin and can be used to install event handlers, listeners, and setup your plugin:
onInstall()- Invoked when the plugin enters the runtime stage.
onStartup()- Invoked when the plugin has been installed.
onUninstall()- Invoked when the plugin has been uninstalled.
isInstalled()- Can be invoked to determine if the plugin has been installed yet.
registerCommand(io.gomint.command.Command)- Invoke to register your own commands.
registerListener(io.gomint.event.EventListener)- Invoke to register your own event listeners.
unregisterListener(io.gomint.event.EventListener)- Invoke to remove an event listener.
dataFolder()- Returns the data folder for this plugin as a File object.
pluginManager()- Returns the plugin manager of the GoMint server.
name()- Returns the name of this plugin.
version()- Returns the version of this plugin.
logger()- Returns the Logger of this plugin.
scheduler()- Returns the plugin scheduler.
server()- Returns an instance of the GoMint server.