Write plugins for your Minecraft Bedrock server in any language, built on top of the Dragonfly server software.
| Benefit | Description |
|---|---|
| 🌍 Any Language | JavaScript, TypeScript, PHP, Python, Rust, C++, Go—if it can speak gRPC, it can be a plugin. |
| 💰 Sell Plugins | Compile to a binary (Rust, Go, C++) and ship closed-source builds. |
| 🔥 Hot Reload | Edit JS/TS/PHP plugins while the server runs; changes apply immediately. |
| 📱 Remote Control | Plugins connect over gRPC, so you can run them on your phone, a web app, or a remote service. |
| 📦 Use Any Library | Mix npm packages, Python ML libs, or anything else your runtime supports. |
| ⚡ Zero Performance Impact | Plugins live in separate processes, so heavy work never blocks Dragonfly’s TPS. |
| 🚀 High Performance (SOON) | The protocol is optimized protobuf with room for batching. |
| 🔒 Sandboxing | Grant only the permissions each plugin needs over the gRPC interface. |
# Hot reload: Edit plugin code while server is running
vim plugins/my-plugin.js # Make changes
# Changes apply immediately - no restart!
# Remote plugin: Control server from your phone
# Plugin runs on your phone, connects to server over internet
phone-app → [gRPC] → Dragonfly Server
# Binary plugin: Sell without source code
rustc plugin.rs --release # Compile to binary
# Distribute the binary - customers can't see your code- Event-driven API: Subscribe to joins, chat, commands, block events, and more.
- Generated types: Proto definitions live in
proto/types/with generated Go + TypeScript stubs underproto/generated/. - Language samples: TypeScript, Node, PHP, and more under
examples/plugins/to kick-start new plugins. - Automation ready:
make proto(buf + scripts) andmake runwire up the host for you.
┌─────────────────┐ gRPC Stream ┌──────────────────┐
│ │ ←──────────────────────────→ │ │
│ Dragonfly │ Events: JOIN, CHAT, etc. │ Your Plugin │
│ Server (Go) │ Actions: TELEPORT, etc. │ (Any Language) │
└─────────────────┘ └──────────────────┘
- Server starts and loads plugin configuration from
cmd/plugins/plugins.yaml. - Plugin process launches via the configured command (for example
node plugin.js). - Handshake occurs where the plugin registers its metadata and commands.
- Plugin subscribes to the events it wants.
- Events flow from Dragonfly to the plugin in real time.
- Plugin executes actions by sending protobuf messages back to the host.
- Go 1.22+ with
GOBINon yourPATH. - buf and
protoc-gen-go(go install google.golang.org/protobuf/cmd/protoc-gen-go@latest).
- Clone & bootstrap
git clone https://github.com/secmc/plugin.git cd plugin go mod download make proto - Configure a plugin in
cmd/plugins/plugins.yaml:plugins: - id: example-typescript name: Example TypeScript Plugin command: "npm" args: ["run", "dev", "--prefix", "examples/plugins/typescript"] address: "unix:///tmp/dragonfly_plugin.sock"
- Run the host
make run
- Iterate in your language – edit the example plugin, or point the config at your own command/binary.
- Copy an example from
examples/plugins/or start fresh withproto/types/plugin.proto. - Run
make proto(orbuf generatewith your template) to refresh client stubs. - Add your command + args + socket info to
cmd/plugins/plugins.yaml. - Implement the handshake: reply to
PluginHello, register commands, then sendEventSubscribe. - Handle streamed events and reply with
ActionBatchorEventResultmessages. Because plugins speak gRPC, they can run locally, over loopback TCP, or on a remote machine.
make proto # regenerate protobuf artifacts + post-gen scripts
go test ./... # run all Go suites
make run # launch Dragonfly host with sample config
npm run dev --prefix examples/plugins/typescript # TypeScript live dev
examples/plugins/php/bin/php7/bin/php examples/plugins/php/src/HelloPlugin.php # PHP sample