Need a /ping source code

Discussion in 'Plugin Development' started by foldagerdk, Jun 4, 2012.

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

    foldagerdk

    I need the source code for a plugin that when you type a command, responds with a message.
    If anyone has one, please let me know :)
     
  2. Offline

    CarlosArias604

    From what I recall it goes like this:

    (You don't need the "if (args.length == 0)" It's just a habit of mine.)
    Code:
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args ){
            if (cmd.getName().equalsIgnoreCase("TestCommand") || commandLabel.equalsIgnoreCase("TestCommandAlias")){
                if (args.length == 0){
                    sender.sendMessage("Stuff you want here!");
               
                }
            }
    Tell me if it didn't work, Cause I may of typed something wrong!

    -C
     
  3. Offline

    foldagerdk

    Thanks, I'll test it out and respond asap!

    I changed it a little, and got some help from a friend and it works fine now :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  4. Offline

    CarlosArias604

    M'kay sounds good! ;)

    -C
     
Thread Status:
Not open for further replies.

Share This Page