Reload Command

Discussion in 'Plugin Development' started by ThePluginMaker, Aug 3, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    ThePluginMaker

    What is the simplest way to add a reload command? as in it just reload the config
     
  2. Offline

    xTigerRebornx

    ThePluginMaker Depends on what "config" you are using. Assuming you mean JavaPlugin#getConfig(), a command that calls reloadConfig() would be the easiest.
     
  3. Offline

    ThePluginMaker

    xTigerRebornx
    Would this work, i'm using the default config.yml or just the default config
    if (cmd.getName().equalsIgnoreCase("cb") && player.hasPermission(cmd.getPermission() + ".reload")) {
    Code:java
    1. if (cmd.getName().equalsIgnoreCase("cb") && player.hasPermission(cmd.getPermission() + ".reload")) {
    2. if (args.length > 0) {
    3. if (args[0].equals("reload")) {
    4. reloadConfig();
    5. }
    6. }
    7. }
     
  4. Offline

    xTigerRebornx

Thread Status:
Not open for further replies.

Share This Page