Invalid plugin.yml?

Discussion in 'Spigot Plugin Development' started by teeter11, Jul 12, 2015.

  1. I get this error :

    [10:30:35 ERROR]: Could not load 'plugins\Test.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:164) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:291) [spigot.jar:git-Spigot-f928e7a-e91aed8]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [spigot.jar:git-Spigot-f928e7a-e91aed8]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:528) [spigot.jar:git-Spigot-f928e7a-e91aed8]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_79]
    Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
    found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
    in 'reader', line 7, column 1:

    ^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:420) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:224) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:229) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:229) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:120) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:450) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:381) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:159) ~[spigot.jar:git-Spigot-f928e7a-e91aed8]
    ... 5 more

    Heres what my plugin.yml says :

    main: me.Teeter.BearUnbreakingMain.Unbreaking2Main
    name: BearUnbreaking
    version: 1.0
    commands:
    unbreakable:
    description: makes the item unbreakable

    my code :

    package me.Teeter.BearUnbreaking2;

    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.*;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Unbreaking2Main extends JavaPlugin {

    public void onEnable(){

    }

    @Override
    public boolean onCommand(CommandSender sender, Command cmd,String label, String[] args){
    if (cmd.getName().equalsIgnoreCase("unbreakable")){
    if (!(sender instanceof Player)) {

    return true;
    }
    Player s = (Player) sender;

    //does stuff
    }
    return false;
    }

    }
     
  2. Did you bother to read the error?

    Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
    found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
    in 'reader', line 7, column 1:

    ^

    There is a TAB in your plugin.yml.
     
  3. @dwilson390 is correct.

    Plugin yml's should only have spaces, if you prefer to use tabs in your plugin yml, set your IDE so that tabs are actually spaces.
     

  4. There was a tab at the bottom of the plugin.yml

    Thanks!
     
  5. No problem :)
     
  6. Quick tip, if you ever encounter a problem with your plugin.yml again, or any YML for that matter,
    first try pasting it in here: http://yaml-online-parser.appspot.com/

    I find myself making the same mistakes as well, being used to tabs is simply said, a b*tch :p
     
  7. Or use the essentials versions and select >Other