Yml

Discussion in 'Plugin Development' started by quack123456, Feb 13, 2015.

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

    quack123456

    Im having so much trouble making a YML here is mine
    name: Test
    version : 1.0
    main : me.Kyle.Ducks.Ducks
    author: Kyle
    description: Nothing :p

    commands:
    Duck:
    usage: /Duck
    description: Test command!

    But it keeps saying its resource is out of sync?

    sorry here is it
    Code:
    name: Test
    version : 1.0
    main : me.Kyle.Ducks.Ducks
    author: Kyle
    description: Nothing :P
    commands:
        Duck:
            usage: /Duck
            description: It gives a nice message :D
    
     
    Last edited by a moderator: Feb 13, 2015
  2. Offline

    ColonelHedgehog

    Code:
    description: Nothing :P
    
    And

    Code:
            description: It gives a nice message :D
    The
    Code:
    :D and :P
    , or specifically the extraneous colons in the file are likely causing a YAML malfunction.
     
  3. Offline

    jusinet

    Code:
    name: PluginName
    version: 1.0
    author: YOU
    websiter: http://you.com/
    
    main: right.here
    commands:
         first:
              description: lol.
              usage: /command
              permission: right.here.use
     
  4. Offline

    quack123456

    ah

    @ColonelHedgehog this doesnt work
    Code:
    name: Duck
    version: 1.0
    author: Kyle
    main: me.kyle.Ducks.Ducks
    commands:
         Duck:
              description: lol
              usage: /command
              permission: Ducks.Duck
     
    Last edited by a moderator: Feb 14, 2015
  5. @quack123456 1. 2 spaces not 4
    2. Did you refresh your project?
     
  6. Offline

    quack123456

    Last edited: Feb 14, 2015
  7. Offline

    ColonelHedgehog

    Oh, and another thing:

    The path to your "main" file. You can't have a package name be the same as a file name. I recommend you rename your main class "Main" or something. Took me a solid 2 hours to figure that out. Weird, I know.
     
  8. Offline

    quack123456

    @ColonelHedgehog it that right?
    Code:
    name: Duck
    version: 1.0
    author: Kyle
    
    main: me.kyle.work.Ducks
    commands:
       Duck:
              description: lol
              usage: /command
              permission: Ducks.Duck
     
    Last edited: Feb 14, 2015
  9. Offline

    1Rogue

    Spaces don't really matter, the problem here (per @ColonelHedgehog , I haven't heard of this) is the main class specification.
     
  10. Offline

    quack123456

  11. Offline

    1Rogue

    What's your main class's name, the package it is in (capitalization matters) and your current plugin.yml? Additionally, if you're getting an error, post it here.
     
  12. Offline

    quack123456

    @1Rogue My main class's name is Work and here it is

    Code:
    name: Duck
    version: 1.0
    author: Kyle
    main: me.kyle.Work.Ducks
    commands:
       Duck:
              description: lol
              usage: /command
              permission: Ducks.Duck
     
  13. Offline

    ColonelHedgehog

    If your Main class' name is "work," then you need to have the path be:

    me.kyle.Ducks.Work
     
  14. Offline

    quack123456

    @ColonelHedgehog Doesnt work :(
    Code:
    name: Duck
    version: 1.0
    author: Kyle
    main: me.Kyle.Ducks.Work
    commands:
       Duck:
              description: lol
              usage: /command
              permission: Ducks.Duck
     
  15. Offline

    ColonelHedgehog

    At this point, are you getting any errors?
     
  16. Offline

    quack123456

    @ColonelHedgehog the resource is out of sync in plugin.yml
    Code:
    package me.Kyle.Work;
    
    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 Ducks extends JavaPlugin {
          
        // Initializing the logger
        public static final Logger log = Logger.getLogger("Minecraft");
      
        public void onEnable(){
            log.info(ChatColor.GREEN + "Plugin loaded sucessfully!");
            // Pretty self explanatory - logs this ^ message
        }
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
            //if the type in /hi
            if(cmd.getName().equalsIgnoreCase("Duck")){
                sender.sendMessage(ChatColor.LIGHT_PURPLE + " " + ChatColor.BOLD + "Ducks are Cool");
                //sends a bold light purple message to the sender - message in this case is 'Hello there!'
            }
          
            return true;
          
        }
    }
    Code:
    name: Duck
    version: 1.0
    author: Kyle
    main: me.Kyle.Ducks.Work
    commands:
       Duck:
              description: lol
              usage: /command
              
     
  17. Offline

    caderape

    @quack123456

    The main in the plugin.yml is used for find the main class of your plugin.

    Yu have to put this.
    main: me.Kyle.Work.Ducks

    If it still doesnt work, remove description and usage for test.
    Code:
    commands:
      ducks:
     
  18. Offline

    quack123456

    @caderape
    Code:
    name: Duck
    version: 1.0
    author: Kyle
    main: me.Kyle.Ducks.Work
    commands:
       Duck:
              
    But where do i put the main in my code
     
  19. Offline

    caderape

    @quack123456 Put this in your plugin.yml
    Code:
    name: Duck
    version: 1.0
    author: Kyle
    main: me.Kyle.Work.Ducks
    commands:
      Duck:
    Edit: be care, you have 3 space for the command duck. I'm not sure if it's affect, but you should put 2 spaces everytime.
     
  20. Offline

    quack123456

  21. Offline

    caderape

  22. Offline

    quack123456

    @caderape it says resource is out of sync
     
  23. @quack123456 Click on the project in your workspace and press f5. I am assuming you mean Eclipse won't let you export because the plugin.yml isn't up to date,.
     
  24. Offline

    quack123456

Thread Status:
Not open for further replies.

Share This Page