Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 1 month 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 (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-11T23:24:32.000Z (over 1 year ago)
- Last Synced: 2024-10-30T09:28:09.524Z (3 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
[![Go Reference](https://pkg.go.dev/badge/github.com/brittonhayes/go-minecraft.svg)](https://pkg.go.dev/github.com/brittonhayes/go-minecraft)
![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/brittonhayes/go-minecraft?color=blue&label=Latest%20Version&sort=semver)
[![Go Report Card](https://goreportcard.com/badge/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
```