2026-04-29 13:42:26 +02:00
2026-04-29 13:45:05 +02:00
2026-04-29 13:45:05 +02:00
2026-04-29 13:45:05 +02:00
2026-04-29 13:42:26 +02:00
2026-04-29 13:42:26 +02:00
2026-04-29 13:45:05 +02:00
2026-04-29 13:45:05 +02:00
2026-04-29 13:45:05 +02:00
2026-08-15 10:59:24 -07:00
2026-04-29 13:45:05 +02:00

Pumpkin Plugin API for Go

This package provides everything needed to write a Pumpkin server plugin compiled to WebAssembly using Go.

Quick start

  1. Initialize your Go module:
go mod init github.com/yourname/yourplugin
go get github.com/Pumpkin-MC/pumpkin-api-go
  1. Create your plugin (main.go):
package main

import (
	"github.com/Pumpkin-MC/pumpkin-api-go/api"
	"github.com/Pumpkin-MC/pumpkin-api-go/pkg/pumpkin_plugin_context"
	"github.com/Pumpkin-MC/pumpkin-api-go/pkg/pumpkin_plugin_logging"
	_ "github.com/Pumpkin-MC/pumpkin-api-go/pkg/wit_exports"
)

type MyPlugin struct {
	api.DefaultPlugin
}

func (p *MyPlugin) Metadata() api.Metadata {
	return api.Metadata{
		Name:    "my-go-plugin",
		Version: "0.1.0",
		Authors: []string{"you"},
	}
}

func (p *MyPlugin) OnLoad(ctx *pumpkin_plugin_context.Context) {
    pumpkin_plugin_logging.Log(pumpkin_plugin_logging.LevelInfo(), "Go plugin loaded!")
}

func init() {
	api.RegisterPlugin(&MyPlugin{})
}

func main() {}
  1. Build your plugin into a WebAssembly component using TinyGo:
tinygo build -o my_plugin.wasm -target=wasi main.go

Note: You might need to use wit-component to turn the core WASM into a component if your build tool doesn't do it automatically.

S
Description
Pumpkin Plugin API for Go
Readme
90 KiB
0 Stars 1 Watchers 0 Forks
Languages
Go 98.4%
Assembly 1.4%
Shell 0.2%