Solved Why is this .yml wrong?

Discussion in 'Plugin Development' started by Eliteninja42, Feb 16, 2014.

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

    Eliteninja42

    Code:
    name: Classes
    author: EliteNinja42
    main: com.gmail.EliteNinja42.Classes.Classes
    version: 1.0
    commands:
    classes:
      description: Lists all the classes of Classes.
      usage: /classes
      permission: Classes.classes
      permission-message: Your character does not contain the qualities to execute this command.
    class miner:
      description: Activates the miner class.
      usage: /class miner
      permission: Classes.miner
      permission-message: Your character does not contain the qualities to execute this command.
     
  2. Offline

    random_username

    Eliteninja42
    The YAML format is correct. Do you have a stacktrace?
     
  3. Offline

    Eliteninja42

    Code:
    16:28:34 [SEVERE] Could not load 'plugins\Classes.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPlu
    inLoader.java:267)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManage
    .java:133)
            at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugins(CraftServer.j
    va:230)
            at cpw.mods.fml.common.event.FMLServerAboutToStartEvent.<init>(FMLServe
    AboutToStartEvent.java:29)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method
     
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source
     
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown So
    rce)
            at java.lang.reflect.Constructor.newInstance(Unknown Source)
            at cpw.mods.fml.common.LoaderState.getEvent(LoaderState.java:84)
            at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadContro
    ler.java:112)
            at cpw.mods.fml.common.Loader.serverAboutToStart(Loader.java:817)
            at cpw.mods.fml.common.FMLCommonHandler.handleServerAboutToStart(FMLCom
    onHandler.java:309)
            at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(Dedicate
    Server.java:219)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:633)
            at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer
    java:16)
    Caused by: while scanning a simple key
    in 'reader', line 15, column 1:
        permission:Classes.miner
        ^
    could not found expected ':'
    in 'reader', line 16, column 1:
        permission-message: Your charact ...
        ^
     
            at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(Scann
    rImpl.java:465)
            at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.ja
    a:280)
            at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:2
    5)
            at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(Pa
    serImpl.java:558)
            at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
            at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143)
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.jav
    :230)
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159)
            at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:1
    2)
            at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105
     
            at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseCon
    tructor.java:120)
            at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481)
            at org.yaml.snakeyaml.Yaml.load(Yaml.java:412)
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile
    java:188)
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPlu
    inLoader.java:262)
            ... 14 more
    
    random_username
     
  4. Offline

    random_username

    Eliteninja42
    The YAML parser says the file is okay, are you using tabs by any chance?
     
  5. Offline

    Eliteninja42

    random_username I checked and just in case I did the whole thing an it still says that

    Does anyone have any ideas?

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

    HeadGam3z

    Eliteninja42
    Try this:
    Code:
    author: EliteNinja42
    main: com.gmail.EliteNinja42.Classes.Classes
    version: 1.0
    commands:
      classes:
        description: Lists all the classes of Classes.
        usage: /classes
        permission: Classes.classes
        permission-message: Your character does not contain the qualities to execute this command.
      class miner:
        description: Activates the miner class.
        usage: /class miner
        permission: Classes.miner
        permission-message: Your character does not contain the qualities to execute this command.
    Also, I was also thinking, maybe it cannot be "class miner"? Instead, try something like "class-miner" if the above yml doesn't work out correctly.
     
  7. Offline

    Eliteninja42

    It is still wrong
     
  8. Offline

    Eliteninja42

    Can anyone help with this?
     
  9. Offline

    baugh70

    Send me the onEnable method please.

    Eliteninja42

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

    Eliteninja42

    baugh70
    Code:
    public void onEnable()
          {
            Bukkit.getPluginManager().registerEvents(this, this);
            PluginDescriptionFile pdfFile = getDescription();
            this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion() + " Has Been Enabled!");
            FileConfiguration config = YamlConfiguration.loadConfiguration(getResource("plugin.yml"));
            for (String cmd : config.getConfigurationSection("commands").getKeys(false))
              getCommand(cmd).setPermissionMessage(ChatColor.RED + "Your character does not contain the qualities to execute this command.");
          }
    baugh70

    Can someone please help me...?

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

    minecraft124_

    In the second command, "class miner" should just be "class". "miner" is an argument, not part of the command name.
     
  12. Offline

    baugh70

    The problem is that you are getting the description from the plugin.yml when there is none.

    Eliteninja42

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

    Eliteninja42

    fixed, thank you guys!
     
Thread Status:
Not open for further replies.

Share This Page