Plugin.yml Error

Discussion in 'Plugin Development' started by nuno1212sss, Dec 25, 2013.

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

    nuno1212sss

    Hi i'm creating a big plugin and i got this error:
    Code:java
    1. org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    2. at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:257)
    3. at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
    4. at org.bukkit.craftbukkit.v1_6_R3.CraftServer.loadPlugins(CraftServer.java:245)
    5. at org.bukkit.craftbukkit.v1_6_R3.CraftServer.reload(CraftServer.java:616)
    6. at org.bukkit.Bukkit.reload(Bukkit.java:277)
    7. at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:24)
    8. at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:192)
    9. at org.bukkit.craftbukkit.v1_6_R3.CraftServer.dispatchCommand(CraftServer.java:532)
    10. at net.minecraft.server.v1_6_R3.PlayerConnection.handleCommand(PlayerConnection.java:986)
    11. at net.minecraft.server.v1_6_R3.PlayerConnection.chat(PlayerConnection.java:897)
    12. at net.minecraft.server.v1_6_R3.PlayerConnection.a(PlayerConnection.java:838)
    13. at net.minecraft.server.v1_6_R3.Packet3Chat.handle(SourceFile:49)
    14. at org.spigotmc.netty.NettyNetworkManager.b(NettyNetworkManager.java:230)
    15. at net.minecraft.server.v1_6_R3.PlayerConnection.e(PlayerConnection.java:117)
    16. at net.minecraft.server.v1_6_R3.ServerConnection.b(SourceFile:37)
    17. at org.spigotmc.netty.NettyServerConnection.b(NettyServerConnection.java:132)
    18. at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:594)
    19. at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:240)
    20. at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:483)
    21. at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:415)
    22. at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
    23. Caused by: org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
    24. at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:200)
    25. at org.yaml.snakeyaml.reader.StreamReader.<init>(StreamReader.java:60)
    26. at org.yaml.snakeyaml.Yaml.load(Yaml.java:412)
    27. at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:188)
    28. at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:252)
    29. ... 20 more
    30. Caused by: java.nio.charset.MalformedInputException: Input length = 1
    31. at java.nio.charset.CoderResult.throwException(CoderResult.java:277)
    32. at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:338)
    33. at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
    34. at java.io.InputStreamReader.read(InputStreamReader.java:184)
    35. at org.yaml.snakeyaml.reader.UnicodeReader.read(UnicodeReader.java:123)
    36. at java.io.Reader.read(Reader.java:140)
    37. at org.yaml.snakeyaml.reader.StreamReader.update(StreamReader.java:184)
    38. ... 24 more

    My plugin.yml:
    Code:
    name: Mega
    main: nl.Nuno1212SsS.Mega.Main.Main
    version: 1.01
    description: Primeiro Plugin
    commands:
      Vender:
          description: Main Command!.
      Loja:
          description: Main Command!.
      Plots:
          description: Main Command!..
      Encantar:
          description: Main Command!.
      Comandos:
          description: Main Command!.
      Arenas:
          description: Main Command!.
      Ranks:
          description: Main Command!.
      Aranha:
          description: Main Command!.
      Blaze:
          description: Main Command!.
      EnderMan:
          description: Main Command!.
      Preços:
          description: Main Command!.
      Evento:
          description: Main Command!.
      hidenseek:
          description: Main Command!.
      Parkour:
          description: Main Command!.
      Sugestoes:
          description: Main Command!.
      Transmitir:
          description: Main Command!.
      Zombie:
          description: Cura uma Pessoa!.
      Aranha:
          description: Cura uma Pessoa!.
      Esqueleto:
          description: Cura uma Pessoa!.
      Aranhadacave:
          description: Cura uma Pessoa!.
      Pigman:
          description: Cura uma Pessoa!.
      Ghast:
          description: Cura uma Pessoa!.
      Blaze:
          description: Cura uma Pessoa!.
      Creeper:
          description: Cura uma Pessoa!.
      Enderman:
          description: Cura uma Pessoa!.
      Slime:
          description: Cura uma Pessoa!.
      Magmacube:
          description: Cura uma Pessoa!.
      Silverfish:
          description: Cura uma Pessoa!.
      Spiderjockey:
          description: Cura uma Pessoa!.
      Wither:
          description: Cura uma Pessoa!.
      Witherboss:
          description: Cura uma Pessoa!.
      Enderdragon:
          description: Cura uma Pessoa!.
      Herobrine:
          description: Cura uma Pessoa!.
    My main class:
    Code:java
    1. package nl.Nuno1212SsS.Mega.Main;
    2.  
    3. import java.util.ArrayList;
    4. import java.util.HashMap;
    5. import java.util.logging.Logger;
    6.  
    7. import net.milkbowl.vault.economy.Economy;
    8. import net.milkbowl.vault.permission.Permission;
    9. import nl.Nuno1212SsS.Mega.AjudaChat.Manager;
    10. import nl.Nuno1212SsS.Mega.BukkitRunnables.TimerRun;
    11. import nl.Nuno1212SsS.Mega.Comands.Arenas;
    12. import nl.Nuno1212SsS.Mega.Comands.Comandos;
    13. import nl.Nuno1212SsS.Mega.Comands.Encantar;
    14. import nl.Nuno1212SsS.Mega.Comands.Loja;
    15. import nl.Nuno1212SsS.Mega.Comands.Plots;
    16. import nl.Nuno1212SsS.Mega.Comands.Preços;
    17. import nl.Nuno1212SsS.Mega.Comands.Ranks;
    18. import nl.Nuno1212SsS.Mega.Comands.Sugestões;
    19. import nl.Nuno1212SsS.Mega.Comands.Transmitir;
    20. import nl.Nuno1212SsS.Mega.Comands.Vender;
    21. import nl.Nuno1212SsS.Mega.Listeners.AntiPalavroes;
    22. import nl.Nuno1212SsS.Mega.Listeners.DeathDrops;
    23. import nl.Nuno1212SsS.Mega.Minas.Aranhaa;
    24. import nl.Nuno1212SsS.Mega.Minas.Blazee;
    25. import nl.Nuno1212SsS.Mega.Minas.CaveSpider;
    26. import nl.Nuno1212SsS.Mega.Minas.Creepeer;
    27. import nl.Nuno1212SsS.Mega.Minas.EnderDragon;
    28. import nl.Nuno1212SsS.Mega.Minas.EnderMann;
    29. import nl.Nuno1212SsS.Mega.Minas.Ghastt;
    30. import nl.Nuno1212SsS.Mega.Minas.Magma;
    31. import nl.Nuno1212SsS.Mega.Minas.Pigmann;
    32. import nl.Nuno1212SsS.Mega.Minas.Silver;
    33. import nl.Nuno1212SsS.Mega.Minas.Skeleton;
    34. import nl.Nuno1212SsS.Mega.Minas.Slimee;
    35. import nl.Nuno1212SsS.Mega.Minas.SpiderJockeyy;
    36. import nl.Nuno1212SsS.Mega.Minas.Wither;
    37. import nl.Nuno1212SsS.Mega.Minas.WitherBoss;
    38. import nl.Nuno1212SsS.Mega.Minas.Zombiee;
    39. import nl.Nuno1212SsS.Mega.PvpSoups.AntiSoupRename;
    40. import nl.Nuno1212SsS.Mega.PvpSoups.AtivarMenuSopas;
    41. import nl.Nuno1212SsS.Mega.PvpSoups.CraftSoupMenu;
    42. import nl.Nuno1212SsS.Mega.PvpSoups.EatSoup;
    43. import nl.Nuno1212SsS.Mega.PvpSoups.SoupMenu;
    44. import nl.Nuno1212SsS.Mega.Signs.Aranha;
    45. import nl.Nuno1212SsS.Mega.Signs.Aranhadacave;
    46. import nl.Nuno1212SsS.Mega.Signs.Blaze;
    47. import nl.Nuno1212SsS.Mega.Signs.Creeper;
    48. import nl.Nuno1212SsS.Mega.Signs.Cubo;
    49. import nl.Nuno1212SsS.Mega.Signs.EnderMan;
    50. import nl.Nuno1212SsS.Mega.Signs.Esqueleto;
    51. import nl.Nuno1212SsS.Mega.Signs.Fish;
    52. import nl.Nuno1212SsS.Mega.Signs.Ghast;
    53. import nl.Nuno1212SsS.Mega.Signs.Jockey;
    54. import nl.Nuno1212SsS.Mega.Signs.Pigman;
    55. import nl.Nuno1212SsS.Mega.Signs.Slime;
    56. import nl.Nuno1212SsS.Mega.Signs.Zombie;
    57. import nl.Nuno1212SsS.Mega.UmvsUm.Aceitar;
    58. import nl.Nuno1212SsS.Mega.UmvsUm.Comando;
    59. import nl.Nuno1212SsS.Mega.UmvsUm.CommandExpire;
    60. import nl.Nuno1212SsS.Mega.UmvsUm.Death;
    61. import nl.Nuno1212SsS.Mega.UmvsUm.EndMatch;
    62. import nl.Nuno1212SsS.Mega.UmvsUm.StartMatch;
    63. import nl.Nuno1212SsS.Mega.WarpMenu.Menu;
    64.  
    65. import org.bukkit.Bukkit;
    66. import org.bukkit.ChatColor;
    67. import org.bukkit.Material;
    68. import org.bukkit.command.Command;
    69. import org.bukkit.command.CommandSender;
    70. import org.bukkit.entity.Player;
    71. import org.bukkit.inventory.ItemStack;
    72. import org.bukkit.inventory.ShapedRecipe;
    73. import org.bukkit.inventory.ShapelessRecipe;
    74. import org.bukkit.inventory.meta.ItemMeta;
    75. import org.bukkit.plugin.PluginManager;
    76. import org.bukkit.plugin.RegisteredServiceProvider;
    77. import org.bukkit.plugin.java.JavaPlugin;
    78.  
    79. @SuppressWarnings("unused")
    80. public class Main extends JavaPlugin {
    81. Logger mylogger = Bukkit.getLogger();
    82. HashMap<Player, ArrayList<Player>> i = Manager.getInstance().getIgnore();
    83. public static Permission permission = null;
    84. public static Economy econ = null;
    85. private Menu menu;
    86. private SoupMenu soupmenu;
    87. private CraftSoupMenu craftsoup;
    88. private TimerRun ruun;
    89. private Comando ca;
    90. private CommandExpire expire;
    91. private EndMatch end;
    92. private StartMatch start;
    93. public static Economy economy = null;
    94. public int number = 60;
    95.  
    96. public void onEnable() {
    97. getConfig().options().copyDefaults(true);
    98. saveConfig();
    99. Bukkit.getServer().getLogger().info("Server Enabled");
    100. PluginManager pm = Bukkit.getServer().getPluginManager();
    101. if (!setupEconomy()) {
    102. getLogger().severe(
    103. String.format(
    104. "[%s] - Disabled due to no Vault dependency found",
    105. getDescription().getName()));
    106. getServer().getPluginManager().disablePlugin(this);
    107.  
    108. return;
    109. }
    110. menu = new Menu(this);
    111. soupmenu = new SoupMenu(this);
    112. craftsoup = new CraftSoupMenu(this);
    113. ItemStack sc = new ItemStack(Material.MUSHROOM_SOUP);
    114. ItemMeta im = sc.getItemMeta();
    115. im.setDisplayName("Sopa de carvao");
    116. sc.setItemMeta(im);
    117. ItemStack si = new ItemStack(Material.MUSHROOM_SOUP);
    118. ItemMeta ii = si.getItemMeta();
    119. ii.setDisplayName("Sopa de ferro");
    120. si.setItemMeta(ii);
    121. ItemStack sg = new ItemStack(Material.MUSHROOM_SOUP);
    122. ItemMeta ig = sg.getItemMeta();
    123. ig.setDisplayName("Sopa de Gold");
    124. sg.setItemMeta(ig);
    125. ItemStack sd = new ItemStack(Material.MUSHROOM_SOUP);
    126. ItemMeta id = sd.getItemMeta();
    127. id.setDisplayName("Sopa de Dima");
    128. sd.setItemMeta(id);
    129. ShapedRecipe coalsoup = new ShapedRecipe(sc).shape("***", "*%*", "***")
    130. .setIngredient('*', Material.COAL)
    131. .setIngredient('%', Material.BOWL);
    132. ShapedRecipe ironsoup = new ShapedRecipe(si).shape("***", "*%*", "***")
    133. .setIngredient('*', Material.IRON_INGOT)
    134. .setIngredient('%', Material.BOWL);
    135. ShapedRecipe goldsoup = new ShapedRecipe(sg).shape("***", "*%*", "***")
    136. .setIngredient('*', Material.GOLD_INGOT)
    137. .setIngredient('%', Material.BOWL);
    138. ShapedRecipe dimasoup = new ShapedRecipe(sd).shape("***", "*%*", "***")
    139. .setIngredient('*', Material.DIAMOND)
    140. .setIngredient('%', Material.BOWL);
    141. ShapelessRecipe cobble2 = new ShapelessRecipe(new ItemStack(
    142. Material.COBBLESTONE)).addIngredient(Material.STONE)
    143. .addIngredient(Material.COAL);
    144. ShapelessRecipe stone = new ShapelessRecipe(new ItemStack(
    145. Material.STONE)).addIngredient(Material.COBBLESTONE);
    146. pm.registerEvents(new Death(this), this);
    147. pm.registerEvents(new DeathDrops(), this);
    148. pm.registerEvents(new AntiPalavroes(), this);
    149. pm.registerEvents(new AntiSoupRename(), this);
    150. pm.registerEvents(new EatSoup(), this);
    151. pm.registerEvents(new SoupMenu(null), this);
    152. pm.registerEvents(new Zombie(), this);
    153. pm.registerEvents(new Aranha(), this);
    154. pm.registerEvents(new Esqueleto(), this);
    155. pm.registerEvents(new Aranhadacave(), this);
    156. pm.registerEvents(new Pigman(), this);
    157. pm.registerEvents(new Ghast(), this);
    158. pm.registerEvents(new Creeper(), this);
    159. pm.registerEvents(new Blaze(), this);
    160. pm.registerEvents(new EnderMan(), this);
    161. pm.registerEvents(new Slime(), this);
    162. pm.registerEvents(new Cubo(), this);
    163. pm.registerEvents(new Fish(), this);
    164. pm.registerEvents(new Jockey(), this);
    165. getServer().addRecipe(cobble2);
    166. getServer().addRecipe(stone);
    167. getServer().addRecipe(coalsoup);
    168. getServer().addRecipe(ironsoup);
    169. getServer().addRecipe(goldsoup);
    170. getServer().addRecipe(dimasoup);
    171. getCommand("Arenas").setExecutor(new Arenas());
    172. getCommand("Ranks").setExecutor(new Ranks());
    173. getCommand("vender").setExecutor(new Vender());
    174. getCommand("comandos").setExecutor(new Comandos());
    175. getCommand("Loja").setExecutor(new Loja());
    176. getCommand("Transmitir").setExecutor(new Transmitir(this));
    177. getCommand("Encantar").setExecutor(new Encantar());
    178. getCommand("Preços").setExecutor(new Preços());
    179. getCommand("sugestões").setExecutor(new Sugestões());
    180. getCommand("sopas").setExecutor(new AtivarMenuSopas());
    181. getCommand("plots").setExecutor(new Plots());
    182. getCommand("zombie").setExecutor(new Zombiee());
    183. getCommand("aranha").setExecutor(new Aranhaa());
    184. getCommand("esqueleto").setExecutor(new Skeleton());
    185. getCommand("aranhadacave").setExecutor(new CaveSpider());
    186. getCommand("pigman").setExecutor(new Pigmann());
    187. getCommand("ghast").setExecutor(new Ghastt());
    188. getCommand("blaze").setExecutor(new Blazee());
    189. getCommand("creeper").setExecutor(new Creepeer());
    190. getCommand("enderman").setExecutor(new EnderMann());
    191. getCommand("slime").setExecutor(new Slimee());
    192. getCommand("magmacube").setExecutor(new Magma());
    193. getCommand("silverfish").setExecutor(new Silver());
    194. getCommand("SpiderJockey").setExecutor(new SpiderJockeyy());
    195. getCommand("wither").setExecutor(new Wither());
    196. getCommand("witherboss").setExecutor(new WitherBoss());
    197. getCommand("EnderDragon").setExecutor(new EnderDragon());
    198. getCommand("1vs1").setExecutor(new Comando(this));
    199. getCommand("aceitar").setExecutor(new Aceitar(this));
    200. }
    201.  
    202. @Override
    203. public void onDisable() {
    204. getServer().resetRecipes();
    205. }
    206. private boolean setupEconomy() {
    207. RegisteredServiceProvider<Economy> economyProvider = getServer()
    208. .getServicesManager().getRegistration(
    209. net.milkbowl.vault.economy.Economy.class);
    210. if (economyProvider != null) {
    211. economy = economyProvider.getProvider();
    212. }
    213. return (economy != null);
    214. }
    215. @Override
    216. public boolean onCommand(CommandSender sender, Command cmd,
    217. String commandLabel, String[] args) {
    218. if(!(sender instanceof Player)){
    219. sender.sendMessage(ChatColor.RED + "Players Only");
    220. return true;
    221. }
    222. Player p = (Player) sender;
    223. if (cmd.getName().equalsIgnoreCase("timer")) {
    224. if (!sender.isOp()) {
    225. sender.sendMessage(ChatColor.RED
    226. + "Só ops e admins podem fazer isto!");
    227. return true;
    228. } else {
    229. TimerRun task = new TimerRun();
    230. task.setId(Bukkit.getScheduler().scheduleSyncRepeatingTask(this, task, 0, 20));
    231. }
    232. }
    233.  
    234. return true;
    235. }
    236. }
     
  2. remove the capital letters, both in the command name and description of the command.

    also by convention package names should all be in lowercase.

    after that pass your plugin.yml through a yml parser to check for errors: http://yaml-online-parser.appspot.com/
     
  3. Offline

    nuno1212sss

    teozfrank
    ERROR:

    while scanning for the next token
    found character '\t' that cannot start any token
    in "<string>", line 3, column 1:
    <head>
    ^
     
  4. Offline

    DrJava

    I'm pretty sure you can only use English characters.
     
  5. Offline

    jboy44

    nuno1212sss
    Besides what everybody else has said, I've seen numerous people make this mistake before.

    After your "commands:" in the YML, you indented two spaces, then later on you indented "description:" four times.

    When creating a YML file, all indentations must be the same. You could use 2 spaces, 4, even 6 spaces, but you can't change between the three within one file.

    Hope this works!
     
  6. yep thats why i suggested to pass his yml file through a yml parser just to make sure :)
     
  7. Offline

    jboy44

    teozfrank
    Well judging from his previous post, it seems like he doesn't understand it.

    I don't personally use a YML parser. I prefer to debug the issue myself.
     
  8. Yes but that would waste alot of time on a large config file. Small configs or plugin.ymls are fine to debug manually.
     
  9. Offline

    nuno1212sss

    DrJava jboy44 teozfrank http://pastebin.com/DppqURG6 My new plugin.yml Still doesn't give out a positive Output -,-" Error:
    ERROR:

    while scanning for the next token
    found character '\t' that cannot start any token
    in "<string>", line 3, column 1:
    <head>
    ^
     
  10. Offline

    DrJava

    nuno1212sss Paste removed?

    By the way, it's an error on the 3rd line.
     
  11. Offline

    jboy44

    nuno1212sss
    Still doesn't look like you've fixed most of the mistakes we've told you.

    Get rid of the capitalization in "commands:" and your command names. Also, I don't think that the colons should be spaced apart either.

    Finally, I suggest you make your spacing 4 spaces, as that's what I use. I see you've only indented 3 times.
     
  12. Offline

    nuno1212sss

  13. Offline

    DrJava

     
  14. Offline

    AoH_Ruthless

    nuno1212sss
    This has probably been said numerous times, but according to the most recent post:
    1. Remove capitalization in "Commands" and each of your command names.
    2. You have to add a version setting (i.e version: 1.0)
    3. Remove spaces between the colons. (i.e "name : ..." becomes "name: ...")
    4. Read this
     
Thread Status:
Not open for further replies.

Share This Page