https://github.com/brittonhayes/go-minecraft
An RCON client for minecraft built in Go ✨📦🗡️
https://github.com/brittonhayes/go-minecraft
client go minecraft rcon
Last synced: 3 months ago
JSON representation
An RCON client for minecraft built in Go ✨📦🗡️
- Host: GitHub
- URL: https://github.com/brittonhayes/go-minecraft
- Owner: brittonhayes
- License: gpl-3.0
- Created: 2021-01-31T06:24:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-11T23:24:32.000Z (almost 2 years ago)
- Last Synced: 2025-02-10T06:12:14.462Z (5 months ago)
- Topics: client, go, minecraft, rcon
- Language: Go
- Homepage:
- Size: 50.8 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Go Minecraft
[](https://pkg.go.dev/github.com/brittonhayes/go-minecraft)

[](https://goreportcard.com/report/github.com/brittonhayes/go-minecraft)
> A Go Client for the Minecraft RCON protocol
## Installation
Install with the go get command
```shell
go get github.com/brittonhayes/go-minecraft
```## Documentation
View the full docs on [pkg.go.dev](https://pkg.go.dev/github.com/brittonhayes/go-minecraft)
## Usage
Using the package is as easy as create client, pick the endpoint, and run the method. This applies across every data
type, so it is consistent across the board. Here's a simple example of how to give a player an item in-game.```go
func main() {
// Initialize client
c := minecraft.NewClient("localhost:1234", "password")
// Setup context for request
ctx := context.Background()
// Give the player items
res, err := c.Give(ctx, "johndoe", items.Bedrock, 5)
if err != nil {
panic(err)
}
// Print out the response
fmt.Println(res)
}
```## Examples
For example uses of the package, check out the [example](./example) directory
## Development
If you'd like to contribute to go-minecraft, make sure you have mage installed: https://magefile.org
```shell
# Download dependencies and run tests
mage download
mage test
```