String label

Discussion in 'Plugin Development' started by PrivateAlpha, Feb 28, 2011.

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

    PrivateAlpha

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args)

    What is the "String label" for?
     
  2. Offline

    DerpinLlama

    Labeling stuff.
     
  3. Offline

    PrivateAlpha

    Well that was a bloody pathetic answer. A proper answer please or DONT comment again. >:|

    Will someone please be kind enough to give me an example of its usage? =]
    Still quite new to the onCommand things
    --- merged: Feb 28, 2011 7:19 PM ---
    label - Alias of the command which was used

    Found what i needed now. It gives you the alias that was used
     
  4. Offline

    clash

    The label parameter is the command that the user entered. It is usually the same as command.getName(), but if allowed aliases in your plugin.yml, then label may be one of the aliases, where as command.getName() always returns the primary command name. I generally ignore the label parameter. I cannot think of a need for it unless your command handling code displays what the user entered, or (gasp) the command acts differently when using an alias.
     
Thread Status:
Not open for further replies.

Share This Page