Command not work

Discussion in 'Plugin Development' started by 0verFull, Feb 26, 2015.

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

    0verFull

    Hello guys, I use this mehod to create command but it's doesn't work.
    How fix it?

    package BukkitTest.Cl;

    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Classe1 extends JavaPlugin implements Listener {

    public void onEnable() {
    PluginManager pm = getServer().getPluginManager();
    pm.registerEvents(this, this);
    }


    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    if(cmd.getName().equalsIgnoreCase("test")) {
    sender.sendMessage("Command work");
    }
    return false;
    }
    }
     
  2. Offline

    SuperOriginal

    Look in console for startup errors
     
  3. Offline

    0verFull

    I don't have error in console but I have : Unknow command Type "Help" for Help
    The command work correctly with the PlayerCommandPreprocessEvent but I need a method to can use the command in the console
     
    Last edited: Feb 26, 2015
  4. Offline

    DaanSander

    after sender.sendmessage("command work");
    return true;
     
  5. Offline

    Skionz

    @0verFull Your plugin.yml file is incorrect. Follow the tutorial on the wiki.
     
  6. Offline

    0verFull

    don't Work @DaanSander

    Thank you @Skionz , I forgot to save the command in plugin.yml.

    <Edit by mrCookieSlime: Merged posts. Please don't double post. There is an Edit Button right next to the Date.>
     
    Last edited by a moderator: Feb 26, 2015
Thread Status:
Not open for further replies.

Share This Page