Enable/Disable features

You can simply enable or disable LabyMod features by modifying the default config-values in the plugins/LabyModAPI/config.yml file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
permissions:
  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

Modifying the values for certain players

You can use the PermissionsSendEvent to modify the permissions sent to the player. In this example every operator will be able to use all features that are disabled in the config.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
@EventHandler
public void onPermissionsSend( PermissionsSendEvent event ) {
    Player player = event.getPlayer();

    // Checking whether the player isn't an operator on the server
    if( !player.isOp() ) {
        return;
    }

    // Iterating through all permissions
    for( Entry<Permission, Boolean> permissionEntry : event.getPermissions().entrySet() ) {
        // Enabling this feature for this player
        permissionEntry.setValue( true );
    }
}