Plugin.yml commands and permissions question

Discussion in 'Plugin Development' started by Gopaintman, Nov 22, 2013.

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

    Gopaintman

    So I've always used plugin.yml with multiple commands, each command with no args.
    How would I define a command in the plugin.yml that has args?
    Code:
    #Example plugin.yml
    main: com.test
    version: 0.4
    name: Example
    commands:
      test:
        description: 'Commands for test'
        usage: /test help
        permission: test.help
        permission-message: You do not have permission to access help for test
    permissions:
      test.*:
        children:
          test.help: true
          test.create: true
      test.help:
        default: true
      test.create: 
    
    Question is how would I make the plugin.yml have a permission for lets say "test create" command?
     
  2. Offline

    agokhale1

    Gopaintman
    Using the example below, the only part that you have to register in the plugin.yml is the test part.
    ex.
    Code:java
    1. if(cmd.getName().equalsIgnoreCase("test")) {
    2. if(args.length == 1) {
    3. if(args[0].equalsIgnoreCase("help")) {
    4. sender.sendMessage("Something");
    5. }
    6. }
    7. }
     
  3. Offline

    Gopaintman

    Yes however what if I want the plugin.yml to handle the args part as well?
     
  4. Offline

    boysnnoco

    The plugin.yml stays the same :)
     
  5. Offline

    sgavster

    You have no need to list the args in the plugin.yml; just the base command :D
     
Thread Status:
Not open for further replies.

Share This Page