Protocol

Warning

Using the protocol is just an alternative and is not recommended by us. We recommend you to use the plugin as it provides an API which will be updated frequently.

Message Format

Every JSON message will be sent via a "plugin message" packet. The plugin channel that should be used is called "LMC". The packet's data (a byte-array) consists of two Strings:
1. the message's key (which will be used to find out the message's purpose)
2. the message's contents (a JSON element)

Note

In our protocol a String consists of two components:
varint: the string's length
byte-array: the string's content

Info

This format can be applied to both incoming and outgoing plugin messages.

Sending permissions

You should use the above format to send the permissions to the client. The message's key should be "PERMISSIONS". The data sent must be a JsonObject which basically is a key-value map. The value determines whether the feature is allowed.
This is the default JsonObject that would be sent if no values have been changed:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
{
  "IMPROVED_LAVA": false,
  "CROSSHAIR_SYNC": false,
  "REFILL_FIX": false,
  "GUI_ALL": true,
  "GUI_POTION_EFFECTS": true,
  "GUI_ARMOR_HUD": true,
  "GUI_ITEM_HUD": true,
  "BLOCKBUILD": true,
  "TAGS": true,
  "CHAT": true,
  "ANIMATIONS": true,
  "SATURATION_BAR": true
}

We recommend you to use this enum as a list of all available features:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
public enum Permission {

    // Permissions that are disabled by default
    IMPROVED_LAVA( "Improved Lava", false ),
    CROSSHAIR_SYNC( "Crosshair sync", false ),
    REFILL_FIX( "Refill fix", false ),

    // GUI permissions
    GUI_ALL( "LabyMod GUI", true ),
    GUI_POTION_EFFECTS( "Potion Effects", true ),
    GUI_ARMOR_HUD( "Armor HUD", true ),
    GUI_ITEM_HUD( "Item HUD", true ),

    // Permissions that are enabled by default
    BLOCKBUILD( "Blockbuild", true ),
    TAGS( "Tags", true ),
    CHAT( "Chat features", true ),
    ANIMATIONS( "Animations", true ),
    SATURATION_BAR( "Saturation bar", true );

    private String displayName;
    private boolean defaultEnabled;

    /**
     * @param displayName    the permission's display-name
     * @param defaultEnabled whether or not this permission is enabled/activated by default
     */
    Permission( String displayName, boolean defaultEnabled ) {
        this.displayName = displayName;
        this.defaultEnabled = defaultEnabled;
    }

    public String getDisplayName() {
        return displayName;
    }

    public boolean isDefaultEnabled() {
        return defaultEnabled;
    }
}