[Solved] Get all arguments in onCommand

Discussion in 'Plugin Development' started by Hello Minecraft World, Feb 19, 2012.

Thread Status:
Not open for further replies.
  1. How can i get get all arguments used in a onCommand?
    tried with:
    for (String string : args) {
    setmotd(string);
    }
    but it didn't work anyone know this?
     
  2. Offline

    vYN

    I'm doing it like this:
    Code:java
    1.  
    2. StringBuilder sb = new StringBuilder();
    3. for (String arg : args)
    4. sb.append(arg + " ");

    and then use sb.toString() there u want all the arguments to be xD
     
  3. Offline

    heisan213

    I can't remember the code, but look up in bukkits default commands, /say has a string builder thingymagig :p
     
  4. Thats how I do it!
     
  5. Offline

    vYN

    awesome
     
  6. Although if the arguments are equal to one I have to remove the + " " bit for some reason, I'll try it again without that and post the error.

    Keir
     
Thread Status:
Not open for further replies.

Share This Page