Packets - IAmPhoenix/Minecraft-API-Protocol GitHub Wiki

Packets

0x00 - Keep Alive
0x01 - Request
0x02 - Command
0xFF - Unknown Error

Protocol Version

1.0

Packet format

Field Name Field Type Notes
Key String This is the private key that comes with the plugin.
Action Byte The byte packet that tells the protocol what to do.
Parameter String Some action packets require the parameter, others does not.

Keep Alive

The Keep Alive packet is used to split data into an array that the Plugin can handle.
Each packet or action should be split up with a Keep Alive packet.

Packet ID Field Name Field Type Notes
0x00

Request

This packet is sent by the client to retrieve a large json array.

Packet ID Return Type Notes
0x01 String Returns a JSON String array.

Example Request
This would be the string you would send to the server to tell it to respond with the request output.
Key\0x00\0x01

Example Return

{
    "status": true,
    "players": {
        "online": 1,
        "max": 20,
        "list": {
            "Senither": {
                "health-level": 20,
                "food-level": 20,
                "gamemode": "SURVIVAL"
            }
        }
    },
    "motd": "A Minecraft Server",
    "version": "1.7.2",
    "software": "git-Spigot-1322 (MC: 1.7.2)",
    "plugins": {
        "Minecraft-API": {
            "version": "1.0",
            "authors": [
                "Senither"
            ],
            "description": "A plugin that adds a custom protocol for Minecraft-API.com."
        }
    },
    "worlds": {
        "world": {
            "world-type": "DEFAULT",
            "difficulty": "HARD",
            "gamerules": [
                "commandBlockOutput",
                "doDaylightCycle",
                "doFireTick",
                "doMobLoot",
                "doMobSpawning",
                "doTileDrops",
                "keepInventory",
                "mobGriefing",
                "naturalRegeneration"
            ],
            "pvp-enabled": true
        }
    },
    "uptime": 102,
    "latency": "0.210"
}

Command

This packet is sent by the client to execute commands via the web or any other media. When you use this packet you're required to parse in the Parameter which is this case is the command.
Note: All commands is being executed as the console so watch out for what you send!

Packet ID Return Type Notes
0x02 String Returns a JSON String array.

Example Request
This would be the string you would send to the server to tell it to execute a command.
Key\0x00\0x02\0x00Say This is a command.

Example Return

{
    "message": "Command have been executed successfully",
    "command": "Say This is a command."
}

Unknown Error

This packet is sent by the server to the client when an unknown error occurs.

Packet ID Type Notes
0xFF String This is a Server -> Client Packet only.
⚠️ **GitHub.com Fallback** ⚠️