My simple plugin wont load and I dont know why

Discussion in 'Plugin Development' started by MeneerMan, Sep 18, 2019.

  1. Offline

    MeneerMan

    The Error message:
    [Server thread/ERROR]: Could not load 'plugins\PluginDawn-0.0.1-SNAPSHOT.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml

    not sure what this means.

    The Full Error (maybe?):
    Code:
    Could not load 'plugins\PluginDawn-0.0.1-SNAPSHOT.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:138) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:202) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:775) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
    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 6, column 1:
            basic:
        ^
    
            at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:419) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:586) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:124) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:236) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:227) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:215) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:85) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:139) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.Yaml.load(Yaml.java:452) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:240) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:165) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            ... 5 more
    I bet it all refers to the same mistake I made but I cant quite figure out what I'm doing wrong.



    My Main Class:
    Code:
    package io.github.SteinebachM.PluginDawn;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class PluginDawn extends JavaPlugin {
            @Override
            public void onEnable() {
                getLogger().info("Dawn has been enabled");
            } 
            @Override
            public void onDisable() {
                getLogger().info("Dawn has been disabled");
                }
            @Override
            public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
                    if (sender instanceof Player) {
                      if (args.length == 0) {
                        sender.sendMessage(String.valueOf("Dawnleave") + "§c Invalid Arguments: /Dawnleave <player>");
                         return true;
                       } 
               
                     
                      Player target = Bukkit.getServer().getPlayer(args[0]);
                      if (target == null) {
                         sender.sendMessage(String.valueOf("Dawnleave") + "§c Could not find player!");
                        return true;
                      } 
                       Bukkit.broadcastMessage(ChatColor.YELLOW + args[0] + " has disconnected from " + ChatColor.RESET + ChatColor.GOLD + "WorldScape");
                       sender.sendMessage(String.valueOf("Dawnleave") + "§c You have successfully fake left " + ChatColor.DARK_RED + args[0]);
                     } else {
                     sender.sendMessage("CLAP");
                    } 
                     return false;
                  }
    }
    My Plugin.yml:
    Code:
    name: PluginDawn
    main: PluginDawn.PluginDawn
    version: 0.1
    author: MeneerMan
    commands:
        basic:
            descrription: command for fakeleaving the server, for staff only
            usage: /Dawnleave [player]
            permission: Dawnleave.basic
            permission-message: What are you trying to do mate...
    

    This is the first plugin I've ever tried making and its supposed to display a fake leave message of the player (If you spot some errors or inefficienties feel free to point them out, im here to learn after all :) )
     
    Last edited by a moderator: Sep 18, 2019
  2. Offline

    timtower Moderator Moderator

    @MeneerMan You have tabs in your plugin.yml, you can't have that.
     
    MeneerMan likes this.
  3. Offline

    MeneerMan

    I have edited the tabs out in my plugin.yml code. But its still showing the same exact message. Do I need to refresh something before running and building the plugin again or is it still broken?

    Error:
    Code:
    Could not load 'plugins\PluginDawn-0.0.1-SNAPSHOT.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:170) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:138) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.craftbukkit.v1_14_R1.CraftServer.loadPlugins(CraftServer.java:350) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at net.minecraft.server.v1_14_R1.DedicatedServer.init(DedicatedServer.java:202) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:775) [spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
    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 11, column 1:
    
        ^
    
            at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:419) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:227) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:214) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:144) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.getNode(Composer.java:85) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:108) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:139) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.yaml.snakeyaml.Yaml.load(Yaml.java:452) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:240) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:165) ~[spigot-1.14.4.jar:git-Spigot-94af569-a3fdef8]
            ... 5 more

    My plugin.yml code:
    Code:
    name: PluginDawn
    main: PluginDawn.PluginDawn
    version: 1.0
    author: MeneerMan
    commands:
    basic:
    description: Command for fakeleaving the server, for staff only
    usage: /Dawnleave [player]
    permission: Dawnleave.basic
    permission-message: What are you trying to do mate
    upload_2019-9-18_18-10-13.png
    There isnt even a line 11 anymore, like the error says.
     
    Last edited by a moderator: Sep 18, 2019
  4. Offline

    timtower Moderator Moderator

  5. Offline

    Strahan

    Did you recompile after fixing the plugin.yml? If not, then it won't see the change.
     

Share This Page