Plugin Coding Help

Discussion in 'Bukkit Help' started by cronikkk, Apr 26, 2011.

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

    cronikkk

    Code:
    19:02:07 [SEVERE] Could not load 'plugins\Help.jar' in folder 'plugins':
    java.io.FileNotFoundException: Jar does not contain plugin.yml
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:59)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:160)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:108)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:85)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    I'm coding my first plugin.. I looked at some others sources and saw they had plugin.yml IN the JAR some how. I compiled this with Eclipse.. Can someone tell me how to add the plugin.yml in?


    EDIT: Okay considering I don't have any options i created a blank plugin.yml and now it says
    Code:
    19:08:20 [SEVERE] Could not load 'plugins\Help.jar' in folder 'plugins': name is
     not defined
    org.bukkit.plugin.InvalidDescriptionException: name is not defined
            at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile
    .java:140)
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.
    java:30)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:63)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:160)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:108)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:85)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
     
  2. make sure plugin.yml is in your main folder
    e.x. your directory would say:
    bin
    src
    plugin.yml
    .classpath
    .project
    when you compile the jar, eclipse should do it automatically...
     
  3. Offline

    cronikkk

    read above post :) I edited it.

    EDIT: They didn't add the plugin.yml file automaticly.

    Is there someone that can get on MSN and teamviewer and maybe walk me thru?
     
  4. hmm...
    there was a section on the right in the jar compile menu if i remember correctly. look there?
     
  5. Offline

    cronikkk

    Okay new issue. Now its saying plugin.yml is out of sync with the filesystem. I can't even delete it from the project
     
  6. this happened to me. i kinda forget what i did, sorry. programming is not my strong suite :\
     
  7. Offline

    cronikkk

    Code:
    19:23:23 [SEVERE] Could not load 'plugins\Help.jar' in folder 'plugins':
    java.lang.ClassNotFoundException: Help
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:36)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:24)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:134)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:160)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:108)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:85)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:217)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:204)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:144)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:259)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
    Do you know what this means? I fixed that out of sync
     
  8. do you have main in your help.java?
     
  9. Offline

    cronikkk

    nvm i figured that out but it loads but if i type /help it doesn't do anything.. here is the codew for it

    Code:
        public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
    
            if (sender instanceof Player) {
                Player player = (Player) sender;
                if(commandLabel.equalsIgnoreCase("/help")) {
                    player.sendMessage(ChatColor.RED + "--- Type In One Of These Commands For More Detail ---");
                    player.sendMessage(ChatColor.DARK_GREEN + "/help admins -" + ChatColor.DARK_BLUE + "Who the main Admins are");
                    player.sendMessage(ChatColor.DARK_GREEN + "/help website -" + ChatColor.DARK_BLUE + "Information on our Website");
                    player.sendMessage(ChatColor.DARK_GREEN + "/help leveling -" + ChatColor.DARK_BLUE + "About our Leveling System");
                    player.sendMessage(ChatColor.DARK_GREEN + "/help aboutus -" + ChatColor.DARK_BLUE + "About our Server and what it is");
                    player.sendMessage(ChatColor.DARK_GREEN + "/help object - " + ChatColor.DARK_BLUE + "The object of this server");
                    player.sendMessage(ChatColor.RED + "--- Plugin Coded By Cronikkk ---");
                }
            }
            return true;
        }
     
  10. i don't know to much java, but from what i know, try
    public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {

    if (sender instanceof Player) {
    Player player = Player sender;
    if(commandLabel.equalsIgnoreCase("/help")) {
    player.sendMessage(ChatColor.RED + "--- Type In One Of These Commands For More Detail ---");
    player.sendMessage(ChatColor.DARK_GREEN + "/help admins -" + ChatColor.DARK_BLUE + "Who the main Admins are");
    player.sendMessage(ChatColor.DARK_GREEN + "/help website -" + ChatColor.DARK_BLUE + "Information on our Website");
    player.sendMessage(ChatColor.DARK_GREEN + "/help leveling -" + ChatColor.DARK_BLUE + "About our Leveling System");
    player.sendMessage(ChatColor.DARK_GREEN + "/help aboutus -" + ChatColor.DARK_BLUE + "About our Server and what it is");
    player.sendMessage(ChatColor.DARK_GREEN + "/help object - " + ChatColor.DARK_BLUE + "The object of this server");
    player.sendMessage(ChatColor.RED + "--- Plugin Coded By Cronikkk ---");
    }
    }
    return true;
    }
     
  11. Offline

    cronikkk

    gives an error on Player player = Player sender;
     
  12. ya, that wasn't it :p
    well, let me look some more...

    change everything to
    sender.sendMessage
    sorry, this is not my area :D

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

    cronikkk

    just doens't do anything. says in console:
    19:43:56 [INFO] cronikkk tried command: help
     
  14. hmm. what did it say before?
     
  15. Offline

    cronikkk

    Same thing. Says the plugin loaded fine, but when i type/help it just says that inc onsole and nothing prints out on screen
     
Thread Status:
Not open for further replies.

Share This Page