Plugin won't load invalid yaml

Discussion in 'Plugin Development' started by paully104, Jun 8, 2013.

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

    paully104

    Hey guys im brand new into java and plugin stuff and whatnot and basically here's my problem

    08.06 16:30:18 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    08.06 16:30:18 [Server] SEVERE Could not load 'plugins/BoatCar.jar' in folder 'plugins'

    here's my yaml
    Code:
    name: BoatCar
    version: .0.0.1
    description: Paul's first plugin
    load: STARTUP
    main: boatcar.BoatCar
    commands: boatcar
    
    I'm assuming its the main, however in netbeans that is my main, what exactly am i doing wrong here?
     
  2. Offline

    TheUpdater

    can we see class files name + package name?
     
  3. Offline

    skore87

    My assumption is YAML doesn't like the apostrophe. Surround your description with the double-quote (") to make sure it accepts it.
     
    MUG806 likes this.
  4. Offline

    paully104

    Here's the code
    Code:
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package boatcar;
     
    import org.bukkit.Location;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Boat;
    import org.bukkit.entity.EntityType;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;
    /**
    *
    * @author Paul
    */
    public class BoatCar extends JavaPlugin implements Listener
    {
        @Override
        public void onEnable()
        {
            getServer().getPluginManager().registerEvents(new BoatCar(), this);
           
        }
            public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
           
            if(sender instanceof Player && cmd.getName().equalsIgnoreCase("boatcar")){
                Player p = (Player) sender;
                Location loc = p.getLocation();
                Boat b= (Boat)p.getWorld().spawnEntity(loc.add(5, 0, 0), EntityType.BOAT);
                b.setWorkOnLand(true);
                return true;
            }
          return false;
        }
        @Override
        public void onDisable()
        {
           
        }
       
       
    }
     
       
    
    I tried with the description in "'s and i still recieved the same error.

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

    TheUpdater

    well what is tha name of the package?
     
  6. Offline

    MUG806

    I'd try it without them altogether.
     
  7. Offline

    TheUpdater

    PHP:
            public boolean onCommand(CommandSender senderCommand cmdString labelString[] args){
         
            if(
    sender instanceof Player && cmd.getName().equalsIgnoreCase("boatcar")){
                
    Player p = (Playersender;
                
    Location loc p.getLocation();
                
    Boat b= (Boat)p.getWorld().spawnEntity(loc.add(500), EntityType.BOAT);
                
    b.setWorkOnLand(true);
                return 
    true;
            }
          return 
    false;
        }
    try set that under the on disable as well not in under!
     
  8. Offline

    MUG806

    you could also try this format:

    Code:
    description: >
                 your description here
     
  9. Offline

    paully104

    I removed the description completely and it still says its the .yaml file lol ._.
     
  10. Offline

    Drkmaster83

    This plugin is working for me with this plugin.yml:
    Code:
    name: BoatCar
    version: .0.0.1
    description: Paul's first plugin
    load: STARTUP
    main: boatcar.BoatCar
    commands:
      boatcar:
    
    and this code:
    Code:
    /*
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    */
    package boatcar;
     
    import org.bukkit.Location;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Boat;
    import org.bukkit.entity.EntityType;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;
    /**
    *
    * @author Paul
    */
    public class BoatCar extends JavaPlugin implements Listener
    {
        @Override
        public void onEnable()
        {
            getServer().getPluginManager().registerEvents(new BoatCar(), this);
     
        }
        @Override
        public void onDisable()
        {
     
        }
     
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args)
        {
            if(sender instanceof Player && cmd.getName().equalsIgnoreCase("boatcar"))
            {
                Player p = (Player) sender;
                Location loc = p.getLocation();
                Boat b = (Boat) p.getWorld().spawnEntity(loc.add(5, 0, 0), EntityType.BOAT);
                b.setWorkOnLand(true);
                return true;
            }
            return false;
        }
    }
    
    My guess is that you improperly defined the "boatcar" command.
     
  11. Offline

    skore87

    Woah woah woah. Stop right there.. Don't do this:

    Code:
        @Override
        public void onEnable()
        {
            getServer().getPluginManager().registerEvents(new BoatCar(), this);
    Don't create a new instance of the plugin to sate the requirements of that method. Use the currently instanced BoatCar instead of a new one. To do that use "(this,this)" since it implements Listener already.

    Put a slash (\) in front of the apostrophe instead then. That's the only other thing that would hopefully allow that character in the string.

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

    paully104

    Hmmm well that got it working for you, still not working for me which is weird ._. i'm doing something wrong x.x
     
  13. Offline

    Drkmaster83

    Any stack traces? Describe to me what is happening. A screenshot? Anything?!
     
  14. Offline

    TheTrixsta

    Code:
    name: BoatCar
    main: boatcar.BoatCar
    version: 0.0.1
    description: Paul's first plugin
    commands:
      boatcar:
        description: Base command for the plugin
    Try this

    EDIT: I wouldn't ever start a version number with a "."
     
  15. Offline

    paully104

    This is going to sound really silly but is the yaml in the plugin suppose to be named plugin.yml or BoatCar.yml lol..
     
  16. Offline

    Drkmaster83

    plugin.yml...
     
  17. Offline

    paully104

    I put the plugin.yml in the package and I was told I need to put it seperate when I compile in netbean lol, sorry for the goose chase.
     
  18. Offline

    Drkmaster83

    Gah! Oh well, glad this goose chase is done.
     
Thread Status:
Not open for further replies.

Share This Page