Solved Plugin loads but is not working

Discussion in 'Plugin Development' started by Zoltus, Dec 28, 2016.

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

    SkyrimX

    So it's loading fine?
    And not working?
    It doesn't send anything on console?
     
  2. Offline

    DeCraizq

    1) Let your Main class implement CommandExecutor
    Code:
    public class Battle1vs1 extends JavaPlugin implements Listener, CommandExecutor
    2) Register the Command in your onEnable Part (set the Executor):
    Code:
    this.getCommand("battle1vs1").setExecutor(this);
    this.getCommand("12").setExecutor(this);
    this.getCommand("duel").setExecutor(this);
    Export the Plugin, Reload the Server and it should work.
     
  3. Offline

    timtower Administrator Administrator Moderator

    @DeCraizq 1. JavaPlugin already does that.
    2. If there is no executor set then it takes the main class.
     
  4. Offline

    DeCraizq

    Wait a second.

    Code:
    public boolean onCommand(CommandSender sender, Command cmd, Player pl, String label, String[] args)
    
    Remove the Player argument. That isn't either from JavaPlugin nor from CommandExecutor.
    So change to:

    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
    
     
  5. Offline

    johnny boy

    Don't use minecraft's colour codes, use ChatColor instead.
     
  6. thanks fixed :D
     
Thread Status:
Not open for further replies.

Share This Page