Welcome to the example Python plugin for Endstone servers.
- Python 3.9 or higher.
- Endstone installed and set up in your Python environment.
python-example-plugin/
βββ src/ # Main source directory
β βββ endstone_example/ # Directory for the plugin package
β βββ __init__.py # Initializer for the package, importing ExamplePlugin class from example_plugin.py
β βββ example_plugin.py # Implementation of ExamplePlugin class
β βββ python_command.py # Custom command executor for /python
βββ .gitignore # Git ignore rules
βββ LICENSE # License details
βββ README.md # This file
βββ pyproject.toml # Plugin configuration file which specifies the entrypoint
-
Clone this Repository
git clone https://github.com/EndstoneMC/python-example-plugin.git
-
Navigate to the Cloned Directory
cd python-example-plugin -
Install Your Plugin
When developing the plugin, you may want to install an editable package to your Python environment, this allows you to update the codes without having to reinstall the package everytime:
pip install -e .NOTE: It is strongly recommended to create a virtual environment for your Endstone server and plugins. When installing your plugin using
pip install, please ensure the virtual environment is activated.Ensure your plugin is loaded correctly by checking the server logs or console for the log messages.
-
Package and Distribute Your Plugin
When everything is good to go, you can package your plugin into a
.whl(Wheel) file for easier distribution:pip install pipx pipx run build --wheel
This command will produce a
.whlfile in thedistdirectory. Copy the.whlfile to thepluginsdirectory of your Endstone server. Start the Endstone server and check the logs to ensure your plugin loads and operates as expected.To publish your plugin to a package index such as PyPI, please refer to:
For a deeper dive into the Endstone API and its functionalities, refer to the main Endstone documentation (WIP).
This project is licensed under the MIT License - see the LICENSE file for details.