Skip to content

Commit 7200c1c

Browse files
committed
Rewrite README as a practical template quickstart
Focus on what devs need: what to rename, how to develop with live reload, how to build/install, and how to release.
1 parent 6955b4e commit 7200c1c

File tree

1 file changed

+59
-45
lines changed

1 file changed

+59
-45
lines changed

README.md

Lines changed: 59 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,68 +2,82 @@
22

33
[![Build](https://github.com/EndstoneMC/python-example-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/EndstoneMC/python-example-plugin/actions/workflows/build.yml)
44

5-
An example Python plugin for [Endstone](https://github.com/EndstoneMC/endstone) servers, demonstrating commands,
6-
events, configuration, and permissions.
5+
A starter template for building [Endstone](https://github.com/EndstoneMC/endstone) plugins in Python.
6+
Demonstrates commands, events, configuration, and permissions.
77

8-
## Prerequisites
8+
## Use This Template
99

10-
- Python 3.10 or higher
11-
- [uv](https://docs.astral.sh/uv/) (recommended) or pip
10+
1. Click **Use this template** on GitHub (or fork/clone it)
11+
2. Rename the following to match your plugin:
1212

13-
## Getting Started
13+
| What | Where | Example |
14+
|------|-------|---------|
15+
| Package name | `pyproject.toml` `[project] name` | `endstone-my-plugin` |
16+
| Package directory | `src/endstone_example/` | `src/endstone_my_plugin/` |
17+
| Entry point | `pyproject.toml` `[project.entry-points."endstone"]` | `my-plugin = "endstone_my_plugin:MyPlugin"` |
18+
| Plugin class | `plugin.py` class name + `prefix` | `MyPlugin`, `prefix = "MyPlugin"` |
19+
| Permission prefix | `plugin.py` `permissions` dict keys | `my_plugin.command.*` |
1420

15-
1. **Clone this repository**
21+
3. Set `api_version = "0.11"` (or the Endstone version you target)
22+
4. Delete the example command/listener code and start building
1623

17-
```bash
18-
git clone https://github.com/EndstoneMC/python-example-plugin.git
19-
cd python-example-plugin
20-
```
24+
## Development
2125

22-
2. **Install in development mode**
23-
24-
```bash
25-
uv sync --extra dev
26-
```
26+
```bash
27+
git clone https://github.com/EndstoneMC/python-example-plugin.git
28+
cd python-example-plugin
29+
uv sync --extra dev # Install dependencies
30+
uv run ruff check src/ # Lint
31+
```
2732

28-
3. **Run linting**
33+
For live development on a running server, activate the server's virtualenv and install in
34+
editable mode:
2935

30-
```bash
31-
uv run ruff check src/
32-
```
36+
```bash
37+
pip install -e .
38+
```
3339

34-
4. **Build a wheel for distribution**
40+
Then use `/reload` in-game to pick up code changes without restarting.
3541

36-
```bash
37-
uv build
38-
```
42+
## Project Structure
3943

40-
Copy the `.whl` from `dist/` into your Endstone server's `plugins/` folder.
44+
```
45+
src/endstone_example/
46+
__init__.py Re-exports the plugin class
47+
plugin.py Plugin lifecycle, commands, config
48+
listener.py Event listener (player join/quit)
49+
config.toml Default config (copied on first run)
50+
```
4151

42-
## Structure
52+
## Install on a Server
4353

54+
```bash
55+
uv build
4456
```
45-
python-example-plugin/
46-
├── src/
47-
│ └── endstone_example/
48-
│ ├── __init__.py # Package entry point, re-exports ExamplePlugin
49-
│ ├── plugin.py # Plugin class: lifecycle, config, commands
50-
│ ├── listener.py # Event listener: player join/quit
51-
│ └── config.toml # Default plugin configuration
52-
├── .github/
53-
│ ├── dependabot.yml # Automated dependency updates
54-
│ └── workflows/
55-
│ ├── build.yml # CI: lint
56-
│ └── release.yml # Release automation
57-
├── CHANGELOG.md # Release notes (keepachangelog format)
58-
├── pyproject.toml # Build config, dependencies, tool settings
59-
├── LICENSE # MIT License
60-
└── README.md # This file
61-
```
57+
58+
Copy the `.whl` from `dist/` into your server's `plugins/` folder and restart.
59+
60+
## Releasing
61+
62+
This template includes a GitHub Actions release workflow. To make a release:
63+
64+
1. Add your changes under `## [Unreleased]` in `CHANGELOG.md`
65+
2. Go to **Actions > Release > Run workflow**
66+
3. Enter the version (e.g. `0.5.0`) and run
67+
68+
The workflow validates the version, updates the changelog, creates a git tag and GitHub release,
69+
builds the wheel, publishes to PyPI (if configured), and attaches the `.whl` to the release.
70+
71+
Use **dry run** to preview without making changes.
72+
73+
Versioning is handled automatically by [hatch-vcs](https://github.com/ofek/hatch-vcs): tagged
74+
commits get clean versions (e.g. `0.5.0`), untagged commits get dev versions
75+
(e.g. `0.5.1.dev3`).
6276

6377
## Documentation
6478

65-
For more on the Endstone API, see the [documentation](https://endstone.readthedocs.io).
79+
For more on the Endstone API, see the [documentation](https://endstone.dev/latest/).
6680

6781
## License
6882

69-
This project is licensed under the MIT License. See [LICENSE](LICENSE) for details.
83+
[MIT License](LICENSE)

0 commit comments

Comments
 (0)