No on PLAYER_COMMAND, what do I do?

Discussion in 'Plugin Development' started by spoonikle, Mar 19, 2011.

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

    spoonikle

    I have a plug-in that I want to update to the latest bukkit, this plug-in has its own command interpreter and was coded prior to the removal of PLAYER_COMMAND event.

    I have never made a plug-in that uses commands, pre or post removal, I would like some help with this.

    Thank you for helping me with this very basic question.
     
  2. Offline

    CypherX

    You add the commands your plugin uses to its plugin.yml file:

    Code:
    commands:
        command1:
            description:
            usage:
        command2:
            description:
            usage:
    Then in the main class of your plugin you can call:

    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args)
    {
        if (sender instanceof Player)
        {
            //process commands from in-game
        }
    
     
  3. Offline

    spoonikle

    thank you.
     
Thread Status:
Not open for further replies.

Share This Page