My First Plugin

Discussion in 'Plugin Development' started by Hellramsden, Mar 12, 2012.

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

    Hellramsden

    Hi everyone,

    Basically im trying to write a plugin that will take a int out of a database.
    but i cant even get the first bit to run.

    When i type the command /mypointz in game it doesnt work.

    I have wrote the plugin.yml and it is exporting ok from eclipse.

    Any help appreciated.

    Code:
    package me.scottramsden.mypointz;
     
    import java.util.logging.Logger;
     
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class SrPointz extends JavaPlugin
    {
     
        private static final Logger log = Logger.getLogger("Minecraft");
       
        @Override
        public void onEnable()
        {
           
            log.info("[Pointz Plugin] has been enabled!");
       
           
        }
        @Override
        public boolean onCommand(CommandSender sender , Command cmd, String commandLabel, String[] args)
        {
           
            if(commandLabel.equalsIgnoreCase("mypointz"))
                sender.sendMessage(ChatColor.BLUE + "Your current pointz :");
           
            return false;
           
           
           
        }
       
       
    }
    
     
  2. Offline

    Sorrow

    I'm a newbie like you, but I think that if you want to get help you should say if there are any console errors and, if there are, you should post them here :D
     
  3. general: use command.getName() instead of commanLabel.

    depending on the output:
    return true instead of false if the command went like expected.
    make sure to have the command in the plugin.yml
     
  4. Offline

    Hellramsden

    [SEVERE] Could not load 'plugins/srgamingpointz.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/scottramsden/mypointz/SrPointz : Unsupported major.minor version 51.0


    Found a fix.

    http://www.rune-server.org/runescap...unsupported-major-minor-version-51-0-fix.html

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
Thread Status:
Not open for further replies.

Share This Page