Solved Server Wouldn't Load My Plugin!

Discussion in 'Plugin Development' started by nmdani, May 23, 2014.

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

    nmdani

    Hello, I've started developing plugins just 2 days ago.


    I made a Test plugin but the console comes up with this:
    It says that the plugin.yml is invalid.
    Here is the code:
    Code:java
    1. package com.nmdani.TestPlugin;
    2. //Imports//
    3. import org.bukkit.Bukkit;
    4. import org.bukkit.ChatColor;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.plugin.java.JavaPlugin;
    9.  
    10. public class TestPlugin extends JavaPlugin {
    11. //Enable Message//
    12. public void onEnable(){
    13. getLogger().info("Plugin Enabled!");
    14. }
    15. //Disable Message//
    16. public void onDisable(){
    17. getLogger().info("Plugin Disabled!");
    18. }
    19. public boolean onCommand(CommandSender sender, Command cmd, String label, String[]
    20. args){
    21. //Hello Command//
    22. if(cmd.getName().equalsIgnoreCase("hello")){
    23. if(sender instanceof Player){
    24. sender.sendMessage(ChatColor.GOLD + "Hello!");
    25. }else{
    26. sender.sendMessage(ChatColor.GOLD + "This command cannot be executed from the" + ChatColor.RED + "console" + ChatColor.GOLD + ".");
    27. }
    28. }
    29. //BRB Command//
    30. if(cmd.getName().equalsIgnoreCase("brb")){
    31. if(sender instanceof Player){
    32. Bukkit.broadcastMessage(ChatColor.GRAY + "[" + ChatColor.BOLD + ChatColor.DARK_RED + "Beef" + ChatColor.BOLD + ChatColor.GOLD + "PVP" + ChatColor.GRAY + "]" + ChatColor.AQUA + sender.getName() + ChatColor.RED + "will" + ChatColor.GOLD + "be right back" + ChatColor.RED + ".");
    33. }else{
    34. sender.sendMessage(ChatColor.GOLD + "The" + ChatColor.RED + "console" + ChatColor.GOLD + "cannot leave.");
    35. }
    36. }
    37. return false;
    38. }
    39. }

    But for some unknown reason, the server with the same version of Bukkit would no load it!
    I think it is the plugin.yml. Can you spot any errors?
    I used spaces instead of TABs, so I do not know why it doesn't work.
    Please help me with this!
    Thank You,
    nmdani
     
  2. Offline

    mickedplay

    nmdani I'm not sure if 'prefix' is needed. I never use this in my plugins.yml.

    try this:
    Code:
    name: TestPlugin
    main: com.nmdani.TestPlugin.TestPlugin
    version: 0.1
    description: This is a test plugin!
    author: nmdani
    commands:
      hello:
        description: You greet, we greet!
      brb:
        description: Tells the players on the server that you left the Computer
    
    If it doesn't work try without command descriptions.
     
  3. Offline

    nmdani

    Same error, over and over. Maybe It's a problem with the code.
     
  4. Offline

    RawCode

    what about posting full error text?
     
  5. Offline

    LegoPal92

    FileNotFoundException: Jar does not contain plugin.yml
     
  6. Offline

    nmdani

    This is my new plugin.yml, but it still does not work:
     
Thread Status:
Not open for further replies.

Share This Page