how to enable/disable a command in the plugin.yml

Discussion in 'Plugin Development' started by King V, Dec 25, 2015.

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

    King V

    so i'm working on an update for my essential menu plugin and this version will have a configurable command system. it means that you can make the plugins commands work as "em heal" or "heal" as an example.

    i have it working but if you disable either one it will give you the usage help for it, like if i write "heal" and i have the commands set to start with "em" then it will give me usage help for the "heal" command ("use /heal to heal yourself")...

    so how can i make the command disabling/enabling work properly where the plugin.yml wouldn't interfere with it, and it wouldn't interfere with other plugins commands.

    thanks in advance :D
     
  2. Offline

    567legodude

    @King V Which one do you want, the "em heal" or "heal" or both?
    Can you show us the plugin.yml. Otherwise there is not much we can do.
     
  3. Offline

    King V

    i ment in the plugin config you can select "true" or "false" for the "em" commands

    plugin.yml: http://pastebin.com/J7TFPy0p
     
  4. Offline

    Xerox262

    That doesn't really help either, when you disable it in config do you want it to disable both /heal and /em heal or just /em heal? You need to explain more what you're trying to achieve.
     
  5. Offline

    King V

    i would want to disable ONE of them
     
  6. Offline

    Xerox262

    Then in your em command class check if it's enabled in the config when checking if the subcommand is heal. Since you're refusing to explain it in depth then that's all I can say, be more specific if you don't understand, and post the command class if you need more help.
     
  7. Offline

    567legodude

    @King V If the command is not enabled in the config you want to return true to the onCommand method.
    When you return false to onCommand the server sends the help message to the player (If it exists).
     
Thread Status:
Not open for further replies.

Share This Page