Problem with adding spaces to my commands

Discussion in 'Spigot Plugin Development' started by ThePCModderzz, Mar 20, 2017.

  1. I want to start out with two basic commands (/PvP apply and /PvP help) and I can't seem to get the spaces working, I've tryed a few old methods but they didn't work either can anyone possibly help?
     
  2. Look into command args.
     
  3. The first thing immediately after the slash is going to be the command name. Everything after that is going to be stored in the String array "args". For example, "/pvp help" would be checked like this:
    Code (Text):
    if(!cmd.getName().equalsIgnoreCase("pvp")) return true;
    if(args.length != 1) return true;
    if(!args[0].equalsIgnoreCase("help")) return true;
    //From here, you know the sender has sent "/pvp help"
     
    • Informative Informative x 1
  4. Are you actually using args?
     
  5. This is so poorly written...
     
    • Agree Agree x 3
    • Funny Funny x 1
  6. Well yeah, I would never actually write a command like that - it was just a quick example.
     

Share This Page