{"id":21971356,"url":"https://github.com/wlwanpan/minecraft-wrapper","last_synced_at":"2026-02-05T05:09:29.125Z","repository":{"id":53159445,"uuid":"293014302","full_name":"wlwanpan/minecraft-wrapper","owner":"wlwanpan","description":"A Go package for your Minecraft Server","archived":false,"fork":false,"pushed_at":"2021-05-24T19:15:02.000Z","size":31938,"stargazers_count":23,"open_issues_count":4,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-22T17:47:33.306Z","etag":null,"topics":["minecraft","minecraft-server","nbt"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wlwanpan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-05T06:05:49.000Z","updated_at":"2025-07-07T08:24:51.000Z","dependencies_parsed_at":"2022-09-13T19:10:33.489Z","dependency_job_id":null,"html_url":"https://github.com/wlwanpan/minecraft-wrapper","commit_stats":null,"previous_names":["wlwanpan/msw-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wlwanpan/minecraft-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlwanpan%2Fminecraft-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlwanpan%2Fminecraft-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlwanpan%2Fminecraft-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlwanpan%2Fminecraft-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wlwanpan","download_url":"https://codeload.github.com/wlwanpan/minecraft-wrapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wlwanpan%2Fminecraft-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29113198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T03:44:17.043Z","status":"ssl_error","status_checked_at":"2026-02-05T03:44:12.077Z","response_time":65,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["minecraft","minecraft-server","nbt"],"created_at":"2024-11-29T14:50:19.021Z","updated_at":"2026-02-05T05:09:29.104Z","avatar_url":"https://github.com/wlwanpan.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# minecraft-wrapper\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/wlwanpan/minecraft-wrapper/blob/master/assets/minecraft-gopher.png?raw=true\" alt=\"Minecraft Gopher\"/\u003e\n\u003c/p\u003e\n\n[![GoDoc](https://godoc.org/github.com/wlwanpan/minecraft-wrapper?status.svg)](https://godoc.org/github.com/wlwanpan/minecraft-wrapper)\n[![Build Status](https://codebuild.us-west-2.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoicmdSUjltNjdIODN0dFNQQXgzUUZHajB4WnFxbVVzWDlMOW41VnYvZ2pTUEN5MnBKR1djVUtwNzdraFlNblQyV01HSldGY2w1OXhIZDljOGRqYzlyU3NRPSIsIml2UGFyYW1ldGVyU3BlYyI6IlJieFV3NjZycnM5MGo2QVYiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D\u0026branch=master)](https://us-west-2.console.aws.amazon.com/codesuite/codebuild/597927659010/projects/minecraft-wrapper)\n\n## What is minecraft-wrapper?\n\nWrapper is a Go package that wraps a Minecraft Server (JE) and interacts with it by pushing in commands and reading the server logs. This package is meant to provide nicer APIs for your Go program to manage your minecraft server.\n\n## Installation\n\n```bash\ngo get github.com/wlwanpan/minecraft-wrapper\n```\n\n## Usage\n\n- Starting the server and listening to game events:\n```go\nwpr := wrapper.NewDefaultWrapper(\"server.jar\", 1024, 1024)\nwpr.Start()\ndefer wpr.Stop()\n\n// Listening to game events...\nfor {\n  select {\n  case ev := \u003c-wpr.GameEvents():\n    log.Println(ev.String())\n  }\n}\n```\n\n- Broadcast a `\"Hello\"` message once the server is loaded:\n```go\nwpr := wrapper.NewDefaultWrapper(\"server.jar\", 1024, 1024)\nwpr.Start()\ndefer wpr.Stop()\n\n\u003c-wpr.Loaded()\nwpr.Say(\"Hello\")\n```\n\n- Retrieving a player position from the [`/data get`](https://minecraft.gamepedia.com/Commands/data#get) command:\n```go\nout, err := wpr.DataGet(\"entity\", PLAYER_NAME|PLAYER_UUID)\nif err != nil {\n\t...\n}\nfmt.Println(out.Pos) // [POS_X, POS_Y, POS_Z]\n```\n\n- Save the game and `Tell` a game admin `\"admin-player\"`, when the server is overloading.\n```go\nwpr := wrapper.NewDefaultWrapper(\"server.jar\", 1024, 1024)\nwpr.Start()\ndefer wpr.Stop()\n\u003c-wpr.Loaded()\n\nfor {\n  select {\n  case ev := \u003c-wpr.GameEvents():\n    if ev.String() == events.ServerOverloaded {\n      if err := wpr.SaveAll(true); err != nil {\n        ...\n      }\n      broadcastMsg := fmt.Sprintf(\"Server is overloaded and lagging by %sms\", ev.Data[\"lag_time\"])\n      err := wpr.Tell(\"admin-player\", broadcastMsg)\n      ...\n    }\n  }\n}\n```\n\nFor more example, go to the examples dir from this repo (more will be added soon).\n\nNote: This package is developed and tested on Minecraft 1.16, though most functionalities (`Start`, `Stop`, `Seed`, ...) works across all versions. Commands like `/data get` was introduced in version 1.13 and might not work for earlier versions. :warning: \n\n## Overview\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/wlwanpan/minecraft-wrapper/blob/master/assets/architecture.png?raw=true\" alt=\"Minecraft Wrapper Overview\"/\u003e\n\u003c/p\u003e\n\nIf you are interested, you can visit this [Medium article](https://levelup.gitconnected.com/lets-build-a-minecraft-server-wrapper-in-go-122c087e0023) to learn some of the basic inner working of the wrapper.\n\n## Commands :construction:\n\nThe following apis/commands are from the official minecraft gamepedia [list of commands](https://minecraft.gamepedia.com/Commands#List_and_summary_of_commands) unless otherwise specified.\n\n- [ ] [Attributes](https://minecraft.gamepedia.com/Commands/attribute)\n- [ ] [Advancement](https://minecraft.gamepedia.com/Commands/advancement)\n- [x] [Ban](https://minecraft.gamepedia.com/Commands/ban)\n- [x] [BanIp](https://minecraft.gamepedia.com/Commands/ban#ban-ip)\n- [x] [BanList](https://minecraft.gamepedia.com/Commands/ban#banlist)\n- [ ] [Bossbar](https://minecraft.gamepedia.com/Commands/bossbar)\n- [x] [DataGet](https://minecraft.gamepedia.com/Commands/data#get)\n- [ ] [DataMerge](https://minecraft.gamepedia.com/Commands/data#merge)\n- [ ] [DataModify](https://minecraft.gamepedia.com/Commands/data#modify)\n- [ ] [DataRemove](https://minecraft.gamepedia.com/Commands/data#remove)\n- [x] [DefaultGameMode](https://minecraft.gamepedia.com/Commands/defaultgamemode)\n- [x] [DeOp](https://minecraft.gamepedia.com/Commands/deop)\n- [x] [Difficulty](https://minecraft.gamepedia.com/Commands/difficulty)\n- [ ] [Effect](https://minecraft.gamepedia.com/Commands/effect)\n- [ ] [Enchant](https://minecraft.gamepedia.com/Commands/enchant)\n- [x] [ExperienceAdd](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.ExperienceAdd)\n- [x] [ExperienceQuery](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.ExperienceQuery)\n- [ ] [Fill](https://minecraft.gamepedia.com/Commands/fill)\n- [ ] [ForceLoad](https://minecraft.gamepedia.com/Commands/forceload)\n- [x] [ForceLoadRemoveAll](https://minecraft.gamepedia.com/Commands/forceload)\n- [ ] [Function](https://minecraft.gamepedia.com/Commands/function)\n- [x] [GameEvents](https://pkg.go.dev/github.com/wlwanpan/minecraft-wrapper#Wrapper.GameEvents) - A GameEvent channel of events happening during in-game (Unofficial)\n- [ ] [GameMode](https://minecraft.gamepedia.com/Commands/gamemode)\n- [ ] [GameRule](https://minecraft.gamepedia.com/Commands/gamerule)\n- [x] [Give](https://minecraft.gamepedia.com/Commands/give)\n- [x] [Kick](https://minecraft.gamepedia.com/Commands/kick)\n- [x] [Kill](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.Kill) - Terminates the Java Process (Unofficial)\n- [x] [List](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.List) - Returns an arr of connected player struct\n- [x] [Loaded](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.Loaded) - Returns bool from a read-only channel once the server is loaded (Unofficial)\n- [x] [Reload](https://minecraft.gamepedia.com/Commands/reload)\n- [x] [SaveAll](https://minecraft.gamepedia.com/Commands/save#save-all)\n- [x] [SaveOff](https://minecraft.gamepedia.com/Commands/save#save-off)\n- [x] [SaveOn](https://minecraft.gamepedia.com/Commands/save#save-on)\n- [x] [Say](https://minecraft.gamepedia.com/Commands/say)\n- [ ] [Schedule](https://minecraft.gamepedia.com/Commands/scoreboard)\n- [ ] [Scoreboard](https://minecraft.gamepedia.com/Commands/scoreboard)\n- [x] [Seed](https://minecraft.gamepedia.com/Commands/seed)\n- [ ] [SetBlock](https://minecraft.gamepedia.com/Commands/setblock)\n- [x] [SetIdleTime](https://minecraft.gamepedia.com/Commands/setidletimeout)\n- [ ] [SetWorldSpawn](https://minecraft.gamepedia.com/Commands/setworldspawn)\n- [ ] [SpawnPoint](https://minecraft.gamepedia.com/Commands/spawnpoint)\n- [ ] [Spectate](https://minecraft.gamepedia.com/Commands/spectate)\n- [ ] [SpreadPlayers](https://minecraft.gamepedia.com/Commands/spreadplayers)\n- [x] [Start](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.Start) (Unofficial)\n- [x] [State](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.State) - Returns the current state of the Wrapper (Unofficial)\n- [x] [Stop](https://minecraft.gamepedia.com/Commands/stop)\n- [ ] [StopSound](https://minecraft.gamepedia.com/Commands/stopsound)\n- [ ] [Summon](https://minecraft.gamepedia.com/Commands/summon)\n- [ ] [Tag](https://minecraft.gamepedia.com/Commands/tag)\n- [ ] [Team](https://minecraft.gamepedia.com/Commands/team)\n- [ ] [TeamMsg](https://minecraft.gamepedia.com/Commands/teammsg)\n- [ ] [Teleport](https://minecraft.gamepedia.com/Commands/teleport)\n- [x] [Tell](https://minecraft.gamepedia.com/Commands/tell)\n- [ ] [TellRaw](https://minecraft.gamepedia.com/Commands/tellraw)\n- [x] [Tick](https://godoc.org/github.com/wlwanpan/minecraft-wrapper#Wrapper.Tick) - Returns the running game tick (Unofficial)\n- [ ] [Title](https://minecraft.gamepedia.com/Commands/title)\n- [ ] [Trigger](https://minecraft.gamepedia.com/Commands/trigger)\n- [ ] [Weather](https://minecraft.gamepedia.com/Commands/weather)\n- [ ] [Whitelist](https://minecraft.gamepedia.com/Commands/whitelist)\n- [ ] [WorldBorder](https://minecraft.gamepedia.com/Commands/worldborder)\n\nNote: this list might be incomplete...\n\n## GameEvents :construction:\n\nList of game events and their respective data...\n\n## Minecraft resources\n\n- [Gamepedia](https://minecraft.gamepedia.com)\n- [DigMinecraft](https://www.digminecraft.com/game_commands)\n\n## Help and contributions\n\nFeel free to drop a PR, file an issue or proposal of changes you want to have.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlwanpan%2Fminecraft-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwlwanpan%2Fminecraft-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwlwanpan%2Fminecraft-wrapper/lists"}