Skip to content

Plugin Development

Milo Weinberg edited this page Jan 30, 2021 · 5 revisions

Plugins Development

Intro to Plugin Development for PyMine

Plugin Structure

Folder Structure

  • plugins [folder]
    • my_plugin [folder]
      • __init__.py - contains necessary setup/teardown coroutines and other plugin code, can import other files, is required.
      • plugin.yml - contains information necessary to load the plugin properly, is required
      • any other files / folders the plugin needs

plugin.yml structure

  • This file has two optional keys (git_url and module_folder)
    • git_url is the url of the plugin's git repository, if present, PyMine will automatically update the plugin.
    • module_folder allows the necessary plugin files to be in a sub-folder. Example: my_plugin/src/__init__.py instead of my_plugin/__init__.py.
  • The contents of plugin.yml is passed to the setup() coroutine of a plugin, therefore plugins may use it as their config file.

__init__.py structure

  • This file must contain a setup() coroutine and a teardown() coroutine.
    • The setup() coroutine will be called when the plugin is initialized. This function takes two args, the server instance and the plugin.yml data (dict).
    • The teardown() coroutine will be called when the plugin is unloaded. This function takes just one arg, the server instance.

The fastest, easiest to use, Python-based Minecraft Server.

Clone this wiki locally