Command Executor for a different class file

Discussion in 'Plugin Development' started by Gold_Squadron, May 8, 2013.

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

    Gold_Squadron

    I am currently working on a plugin but all my code is in 1 page which is really annoying me and when I put the code in a different class file in java eclipse I put the wrong extension like extends or listener and if someone can tell me how to do the command executor for the separate class files that would be amazing. Once I do then it will be easier to edit and work with the code.
     
  2. Offline

    Burnett1

    Just create a class and let it implement CommandExecutor. Paste your onCommand code in. You can make multiple class's for each command. Next in your onEnable do getCommand("COMMAND").setExecutor(new CommandsClass());
     
Thread Status:
Not open for further replies.

Share This Page