Permissions
Overview
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:
Requirements
- LabyMod API (or use the Protocol without the API)
Example json
{
"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,
"RANGE": false,
"SLOWDOWN": false
}
Permission enum
We recommend you to use this enum as a list of all available features:
public enum Permission {
// Permissions that are disabled by default
IMPROVED_LAVA( "Improved Lava", false ),
CROSSHAIR_SYNC( "Crosshair sync", false ),
REFILL_FIX( "Refill fix", false ),
RANGE( "Range", false ), // CLASSIC PVP - 1.16 only
SLOWDOWN( "Slowdown", false ), // CLASSIC PVP - 1.16 only
// 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;
}
}