Hey! We have a WIKI!
- Server Downloading
- Server Events (e.g on Player join, on Player Death, on Chat...)
- Sending commands to server
- Easy server creation
- Multiple Server Engine Support
To download the library download the source and put it in to your project's vendor dir. ({myproj}/vendor/mcsrv) and import it by using "github.com/pawelk1337/mcsrv". Make sure to add ./vendor to your go.work file
To create a simple server:
import (
mc "github.com/pawelk1337/mcsrv"
mcsh "github.com/pawelk1337/mcsrv/shared"
)
func main() {
srv, err := mc.NewServer(&mcsh.ServerConfig{
AcceptEula: true,
Path: "./server",
Engine: mcsh.PAPER,
Version: "latest", // Use the latest version
Build: "latest",
Port: "25565",
Host: "127.0.0.1",
InitialHeapSize: 2048, // 2 GB
MaxHeapSize: 2048, // 2 GB
}, log) // log can be nil
if err != nil {
panic(err) // Replace with actual error handling
}
// Start the server
go srv.Start()
println("starting server")
defer srv.Stop()
// Wait for the server to start
<-srv.Wrapper.Loaded()
// Wait for the server to stop
<-srv.Wrapper.Stopped()
}
Check the examples directory
- Gate - High-Performance, Low-Memory, Lightweight, Extensible Minecraft Reverse Proxy with Excellent Multi-Protocol Version Support - Velocity/Bungee Replacement - Ready for dev and large deploy!
- Minecraft Router - Route Minecraft traffic from a configuration file or api.
- go-Liter - A proxy for Minecraft that can be extended with JavaScript
Server DownloadingServer running and Server WrappingMake Servers ImportableCustom Log HandlingFix wrapper.Loaded()add wrapper.Stopped()- Parsing server files (e.g server.properties...)
You can contact me on discord: pawelk1337
(id: 967830338116153496)
Feel free to contact me about anything i will try my hardest to anwser any of your questions.