No commands working?

Discussion in 'Bukkit Help' started by tacomaster981, Aug 14, 2014.

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

    tacomaster981

    is it just me or do no commands work at all?

    I'm making my own plugins and after updating to the latest craftbukkit build, no commands has been working at all!

    I even tried making a simple plugin that would return "Working" to the player that uses the command "command". and it didn't work at all.

    here's the code:

    Code:java
    1. package me.boredgamerz.commands;
    2.  
    3. import java.util.logging.Logger;
    4.  
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.plugin.PluginDescriptionFile;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class commands extends JavaPlugin{
    12. public final Logger logger = Logger.getLogger("Minecraft");
    13. public static commands plugin;
    14.  
    15. public void onDisable() {
    16. PluginDescriptionFile pdfFile = this.getDescription();
    17. this.logger.info(pdfFile.getName() + (" Has Been Disabled"));
    18. }
    19.  
    20.  
    21. public void onEnable() {
    22. PluginDescriptionFile pdfFile = this.getDescription();
    23. this.logger.info(pdfFile.getName() + " Version " + (pdfFile.getVersion() + " Has Been Enabled"));
    24. getConfig().options().copyDefaults(true);
    25. saveConfig();
    26. }
    27.  
    28. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    29. Player player = (Player) sender;
    30. if(commandLabel.equalsIgnoreCase("command")){
    31. player.sendMessage("Works!");
    32. }
    33. return false;
    34.  
    35. }
    36. }
    37.  


    I tried some of my older version plugins. what happened was that I got a error

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  2. Offline

    Necrodoom

    Are you using some sort of a plugin template? If so, stop using it, as its full of bad practice. Rewrite the code according to bukkit wiki practices.
    Also, paste the errors.
     
  3. Offline

    tacomaster981

    Thanku! it was me staying in the "old" code world. i haven't been in the "code" world for almost 1 and half year. so a a little bit behind. It works fine now.
     
Thread Status:
Not open for further replies.

Share This Page