plugin.yml error

Discussion in 'Plugin Help/Development/Requests' started by _Error, Jul 19, 2015.

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

    _Error

    plugin.yml
    Code:
    name: EggyC
    main: com.gmail.ItzError.EggyC
    version: 1.0
    commands:
    hack:
    description: Bans a player, Simple!
    usage: Syntax error! Use /hack (Player) to ban a player.
    scam:
    description: Bans a player for scamming.
    usage: Syntax error! Use /scam (Player) to ban a player.
    spam:
    description: Bans a player for spamming.
    usage: Syntax error! Use /spam (Player) to ban a player.
    swear:
    description: Bans a player for swearing.
    usage: Syntax error! Use /swear (Player) to ban a player
    Error:
    Code:
    19.07 05:04:23 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1079) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:625) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.Bukkit.reload(Bukkit.java:543) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:723) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:288) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 05:04:23 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    19.07 05:04:23 [Server] ERROR Could not load 'plugins/EggyC.jar' in folder 'plugins'
     
  2. Uhm gimme a second :D Maybe you shouldn't use the () in yor description. :)
     
  3. Offline

    Lilret123

  4. Offline

    _Error

  5. Offline

    Lilret123

    can you provide a screenshot of the actual file?
    @_Error
     
  6. Offline

    _Error

    @Lilret123
    bandicam 2015-07-19 15-33-05-715.jpg
    That's not correct xD Was trying some stuff out, The main is com.gmail.ItzError.EggyC.Main

    Main class:
    Code:
    package com.gmail.ItzError.EggyC;
    
    import org.bukkit.Bukkit;
    import org.bukkit.Material;
    import org.bukkit.configuration.file.FileConfiguration;
    import org.bukkit.configuration.file.YamlConfiguration;
    import org.bukkit.event.Listener;
    import org.bukkit.inventory.ItemStack;
    import org.bukkit.inventory.ShapelessRecipe;
    import org.bukkit.inventory.meta.ItemMeta;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.java.JavaPlugin;
    
    import java.io.File;
    import java.util.logging.Logger;
    
    public class Main extends JavaPlugin implements Listener{
    private static Plugin plugin;
    public static Logger log = Logger.getLogger("Minecraft");
    public static File conf;
    public static FileConfiguration config;
    public Main() {
    }
    public void onEnable() {
    ItemStack is = new ItemStack(Material.STONE, 1);
    is.setDurability((short) 3);
    ShapelessRecipe sr = new ShapelessRecipe(is);
    sr.addIngredient(1, Material.COBBLESTONE);
    sr.addIngredient(1, Material.STONE);
    Bukkit.addRecipe(sr);
    
    
    ItemStack is2 = new ItemStack(Material.STONE, 1);
    is2.setDurability((short) 5);
    ShapelessRecipe sr2 = new ShapelessRecipe(is2);
    sr2.addIngredient(1, Material.STONE);
    sr2.addIngredient(1, Material.STONE);
    Bukkit.addRecipe(sr2);
    
    
    ItemStack is3 = new ItemStack(Material.STONE, 1);
    is3.setDurability((short) 1);
    ShapelessRecipe sr3 = new ShapelessRecipe(is3);
    sr3.addIngredient(1, Material.DIRT);
    sr3.addIngredient(1, Material.STONE);
    Bukkit.addRecipe(sr3);
    
    ItemStack is4 = new ItemStack(Material.SEA_LANTERN, 1);
    ShapelessRecipe sr4 = new ShapelessRecipe(is4);
    sr4.addIngredient(1, Material.GOLD_INGOT);
    sr4.addIngredient(1, Material.GLOWSTONE);
    Bukkit.addRecipe(sr4);
    if(conf == null) {
    conf = new File(getDataFolder(), "config.yml");
    }
    config = YamlConfiguration.loadConfiguration(conf);
    
    ConfigSetup.saveConfig();
    
    plugin = this;
    registerEvents(this, new Snowballs(), new ChatCooldown(), new onJoinonQuit(), new DoubleJump(), new MOTD(), new Utils(), new BlameError(), new Elevators(), new OreGen());
    // this.getCommand("cmd").setExecutor(new class());this.getCommand("hack").setExecutor(new HackSystem());
    this.getCommand("scam").setExecutor(new HackSystem());
    this.getCommand("spam").setExecutor(new HackSystem());
    this.getCommand("swear").setExecutor(new HackSystem());
    
    
    }
    
    public void onDisable() {
    plugin = null;
    }
    
    public static void registerEvents(Plugin plugin, Listener... listeners) {
    
    for (Listener listener : listeners) {
    Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
    
    }
    }
    
    public static Plugin getPlugin() {
    return plugin;
    }
    }
    I tried that too.
    bandicam 2015-07-19 15-37-16-161.jpg
     
    Last edited: Jul 19, 2015
  7. Offline

    SuperSniper

    Maybe making each command in a different class?

    Code:
    this.getCommand("scam").setExecutor(new HackSystem());
    this.getCommand("spam").setExecutor(new HackSystem());
    this.getCommand("swear").setExecutor(new HackSystem());
    
     
  8. Offline

    _Error

    Does not matter, This plugin worked before, but then for some reason it stopped working, This way totally works.
     
  9. Offline

    _Filip

    You didn't define your main class -_-
     
  10. Offline

    Zombie_Striker

    Code:
    com.gmail.ItzError.EggyC.Main;
    Stick to package naming conventions.

    Are you sure you're using spaces instead of tabs?
     
    bwfcwalshy likes this.
  11. @_Error You seem to have 4 spaces or a tab and then 2 spaces. Stick to either 2 or 4. I prefer 2 because it is harder for programs to indent.
     
  12. Offline

    _Error

    Thats not the issue
    I rewrote the entire plugin.yml anyway, Does not affect it.
    Mhm?


    EDIT: after rewriting thats what I got
    Code:
    19.07 11:31:47 [Server] INFO at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:676) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:60) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_65]
    19.07 11:31:47 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_65]
    19.07 11:31:47 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:939) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1079) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:625) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.Bukkit.reload(Bukkit.java:543) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:723) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:288) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 11:31:47 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    19.07 11:31:47 [Server] ERROR Could not load 'plugins/EggyC.jar' in folder 'plugins'
     
  13. @_Error Please post your updated plugin.yml
     
  14. Offline

    Zombie_Striker

    @_Error
    btw, why do you have a Main constructor that A) does nothing and B) should not be used.

    Code:
    public static void registerEvents(Plugin plugin, Listener... listeners) {
    
    for (Listener listener : listeners) {
    Bukkit.getServer().getPluginManager().registerEvents(listener, plugin);
    
    }
    }
    
    public static Plugin getPlugin() {
    return plugin;
    }
    I'm not even going to ask about the Plugin instance getter, but why would you need to register listeners like this?

    [edit] seems you use the constructor to get the plugin instance/ the registerEvents method. Just provide each class with the plugin instance.
     
  15. Offline

    _Error

    Code:
    name: EggyC
    author: Error
    main: com.gmail.ItzError.EggyC.Main
    version: 1.0
    @Zombie_Striker
    The issue is not there. I used this way from the 1st code I ever wrote.
     
  16. Offline

    Zombie_Striker

    @_Error
    Do you have spaces before 'name', 'author' and the rest of those sections?
     
  17. @_Error Trying add a description
     
  18. Offline

    _Error

    No.
    EDIT : @bwfcwalshy tried that.
     
    Last edited: Jul 19, 2015
  19. Offline

    Zombie_Striker

    @_Error
    And there's your problem. Every line must have atleast two spaces before it.
     
  20. Offline

    _Error

    Tried that, That's what I get
    Code:
    19.07 12:08:24 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:9) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at net.minecraft.server.v1_8_R3.PacketPlayInChat.a(SourceFile:37) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:939) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at net.minecraft.server.v1_8_R3.PlayerConnection.handleCommand(PlayerConnection.java:1079) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:625) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:140) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.Bukkit.reload(Bukkit.java:543) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:723) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:288) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152) ~[craftbukkit-1.8.5-20150523a.jar:git-Bukkit-7bc9c08]
    19.07 12:08:24 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    19.07 12:08:24 [Server] ERROR Could not load 'plugins/EggyC.jar' in folder 'plugins'
     
  21. @Zombie_Striker You don't have spaces infront of the name, main and author.
     
  22. Offline

    Boomer

    plugin.yml isn't in the right location in the project
     
  23. Offline

    _Error

    Are you serious -_- It's in resources, Where it's supposed to be.
     
  24. Offline

    Boomer

    topmost project level, so that when the system jar is made, it is in the initial directory and not a subdirectory

    actually just noticed you're using intellij , and i can't make sense from a checkup search on where it should be in that system, since there are different ways to configure the output.

    Examine your compiled jar file when all is said and done. Is the plugin.yml file immediately accessable or not.

    If it is, then you need to update us with that freshest yml file version - preserving the formatting - and a fresh error message as well.

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

    _Error

    You might be right, I decompiled the jar and I can't see it anywhere, Don't know why tho. And don't know how to fix it.
     
    Last edited: Jul 19, 2015
  26. Offline

    MrFrozen

    'This should be in Development help...
     
  27. Offline

    _Error

    Not my fault, I posted it there but they moved it.
     
  28. Offline

    Zombie_Striker

    This is why they moved it.Updates higher than 1.8 are not supported.
     
    _Error and bwfcwalshy like this.
  29. Offline

    MrFrozen

    xD usless cause so far I know the plugin.yml has no changes so that should be the same like 1.7.9
     
  30. Offline

    _Error

    Help..?
     
Thread Status:
Not open for further replies.

Share This Page