A vanilla Minecraft HTTP JSON server.
Make sure you have Go installed, and make sure you have set your $GOPATH properly, or it will prove difficult to build.
Start by cloning the repository and getting the dependencies.
git clone https://github.com/lukevers/gelato
go get
go build
Specify your config file. Default is /etc/gelato.json
Generate a new config file. If you don't pass the --conf [path/to/gelato.json
flag it will by default try to create a config at /etc/gelato.json
and will fail depending on your permissions.
Specify the webserver port that you want gelato to listen on. The default port is 7033
.
Specify the webserver host that you want gelato to listen on. The default host is 0.0.0.0
.
By default, gelato uses the same format for each API point. Every response will look similar to this, but with a different Body
. All responses are valid JSON, and the comments in these blocks are for informational purposes in this README only.
{
"Status": 200, // HTTP Status Code
"Error": null, // A string if not null
"Body": {
// Body
}
}
If you don't care about Status
and Error
and you only want the contents of Body
there's some good news! By appending the query body=true
to your request you can do that!
{
// Body
}
The API point /server
contains general information about the server. Information about the max number of players the server allows, and the number of current online players are included in this API point for convenience, but the /players
API point is player specific and includes a list of current online players. The body of the response could be similar to this:
{
"GameType": "SMP",
"GameId": "MINECRAFT",
"Version": "1.8",
"Map": "world",
"MaxPlayers": "20",
"NumPlayers": "0",
"Motd": "A Minecraft Server"
}
The API point /server/gametype
contains the current gametype of the server. The body of the response could be similar to this:
{
"GameType": "SMP"
}
The API point /server/gameid
contains the current gameid of the server. The body of the response could be similar to this:
{
"GameId": "MINECRAFT"
}
The API point /server/version
contains the version of the Minecraft server that is running. The body of the response could be similar to this:
{
"Version": "1.8"
}
The API point /server/map
contains the name of the Minecraft server map. The body of the response could be similar to this:
{
"Map": "world"
}
The API point /server/maxplayers
contains the max number of players that the Minecraft server allows. The body of the response could be similar to this:
{
"MaxPlayers": 20
}
The API point /server/numplayers
contains the number of currently online players. The body of the response could be siliar to this:
{
"NumPlayers": 0
}
The API point /server/motd
contains the motd for the Minecraft server. The body of the response could be similar to this:
{
"Motd": "A Minecraft Server"
}
The API point /players
contains information about current online players. It also contains information about the max number of players the server allows. The body of the response could be similar to this:
{
"NumPlayers": 1,
"MaxPlayers": 20,
"OnlinePlayers": ["player1"] // If no players, this is null
}
The API point /players/online
contains a string array of current online players. If there are no players online the result is null. The body of the response could be similar to this:
{
"OnlinePlayers": ["player1"] // If no players, this is null
}