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

    Zoltus

  2. Offline

    SkyrimX

    So it's loading fine?
    And not working?
    It doesn't send anything on console?
     
  3. 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.
     
  4. Online

    timtower Ninja on the waves Moderator

    @DeCraizq 1. JavaPlugin already does that.
    2. If there is no executor set then it takes the main class.
     
  5. 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)
    
     
  6. Offline

    johnny_boy

    Don't use minecraft's colour codes, use ChatColor instead.
     
  7. Offline

    Zoltus

    thanks fixed :D
     
Thread Status:
Not open for further replies.

Share This Page