Solved How to do like a /kick <player> <reason> command?

Discussion in 'Plugin Development' started by EnchantedMiners, May 24, 2014.

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

    EnchantedMiners

    Hey, what the title says :D
    and i only need the StringBuilder for the reason someone help please
    i will understand better if you post a example code or give me a link to a similar post
    i couldn't find any good one out there D:

    Help is apresiated!
     
  2. Offline

    Mayoz

    It sounds like you want us to spoon-feed you. I'm not going to help, unless there's actually an issue. Also I can't understand half of what you're trying to say.
    huh?
    understand what better?
    any good what?
    That's not how you spell appreciated.
     
  3. Offline

    SnipsRevival

    To build a String out of multiple arguments, you can do something like this:

    Code:
            StringBuilder sb = new StringBuilder();
            for(int i = start; i < args.length; ++i) {
                sb.append(args[i]).append(" ");
            }
            String message = sb.toString().trim();
    
    where the variable start is the index of args where you wish to begin building the string, which in your case would be 1.
     
  4. Mayoz
    He's asking too much but you don't need to act like such a dick.
     
    Adriani6 likes this.
  5. Offline

    Mayoz

    RAFA_GATO_FOFO I'm not trying to act like a dick, but honestly if people spoon-feed they don't learn and they come back for more.
     
  6. Mayoz
    You don't need to try, you already acted like that. Plus you harassed him a lot for no reason:
    The post was perfectly understandable even though it was faulty.
     
  7. Offline

    EnchantedMiners

    SnipsRevival
    Thanks man that really worked!
    RAFA_GATO_FOFO
    Thanks for the help with some dick people
    Mayoz
    Yes you acted like a big dick and excuse my english, it isn't my language so keep calm bro i didn't mean to offend you
     
  8. Offline

    EgyptianKing

    If you want to store the reason then make another .yml called Kicked.yml.

    It could look like this to save space:

    PlayerName:Reason

    Example:

    EgyptianKing: Disrespect.

    If you want to use the reason only for temporary than just use the command arguments in onCommand. In this case it would be args[1]

    So you could broadcast a message saying args[0] got kicked for args[1]
     
Thread Status:
Not open for further replies.

Share This Page