[Help] Error when launching my plugin :/!

Discussion in 'Plugin Development' started by Roughbread, Feb 4, 2012.

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

    Roughbread

    I have created(tried to) a plugin that changes the /say command.
    There are no errors in my code that the JDK is picking up, except for when I launch my bukkit server I get this error.
    [​IMG]
    I have tried changing my YAML around, but I still get this error :/ Please help!
     
  2. Offline

    Perdog

    Do you have the main in your plugin.yml pointing to the right class? It's case sensitive and has to be exact.
     
  3. Offline

    Roughbread

    I do indeed :/
    Still isn't working

    Code:
    package mark.plugins.say.SayMessage;
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.command.ConsoleCommandSender;
    import org.bukkit.command.defaults.VanillaCommand;
     
     
     
    public class Main extends VanillaCommand{
     
        public Main() {
            super("say");
            this.description = "Broadcasts the given message as the console";
            this.usageMessage = "/say <message>";
            this.setPermission("bukkit.command.say");   
        }
           
        @Override
        public boolean execute(CommandSender sender, String currentAlias, String[] args) {
            if (!testPermission(sender)) return true;
            if (args.length == 0)  {
                sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
                return false;
            }
     
            StringBuilder message = new StringBuilder();
            if (args.length > 0) {
                message.append(args[0]);
                for (int i = 1; i < args.length; i++) {
                    message.append(" ");
                    message.append(args[i]);
                }
            }
       
            if (!(sender instanceof ConsoleCommandSender)) {
                Bukkit.getLogger().info("[" + sender.getName() + "] " + message);
            }
                Bukkit.broadcastMessage(ChatColor.LIGHT_PURPLE + "[AusChaos] " + message);
               
                return true;
        }
        @Override
        public boolean matches(String input) {
            return input.startsWith("say ") || input.equalsIgnoreCase("say");
        }
        }
    
    Hopefully that might help you/or anyone find the error :/

    NOTE I have changed my package to 'mark.plugins.say.SayMessage' not 'mark.plugins.say' and have also done so in the YAML

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 23, 2016
  4. Offline

    Perdog

    Can you post your Main class as well? Seems like you might be trying to call something in there that's messing up
     
  5. This has saved me in many different circumstances. I don't know if this is your problem but try it anyways.

    http://yaml-online-parser.appspot.com/

    Just copy and paste your YAML file into that.
     
Thread Status:
Not open for further replies.

Share This Page