Solved Can't load this plugin... please help me

Discussion in 'Plugin Development' started by DuB_B_O_S, Aug 23, 2014.

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

    DuB_B_O_S

    I have try to make a Balance gamma and when i try to load it to my server and its wont load it...
    so please help there the codes
    Code:java
    1. package me.staticnetwork.staticbal;
    2.  
    3. import java.text.DecimalFormat;
    4.  
    5. import org.bukkit.Bukkit;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.entity.Player;
    9. import org.bukkit.event.Listener;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11.  
    12. public class StaticBal extends JavaPlugin implements Listener{
    13. public void onEnable() {
    14. Bukkit.getServer().getLogger().info("StaticBal Plugin Enabled!");
    15. }
    16.  
    17. public void onDisable() {
    18. Bukkit.getServer().getLogger().info("StaticBal Plugin Disabled!");
    19. }
    20.  
    21. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    22. if (!(sender instanceof Player)) {
    23. sender.sendMessage("console is not allowed to use balance command!");
    24. return true;
    25. }
    26. double balance = 1234567.89;
    27. DecimalFormat df = new DecimalFormat("###,###,###,###,###.##");
    28. String formattedBalance = df.format(balance);
    29. Player player = (Player) sender;
    30. if (cmd.getName().equalsIgnoreCase("bal")) {
    31. player.sendMessage("Your balance is " + formattedBalance + "!");
    32. }
    33. return true;
    34. }
    35. }
     
  2. Offline

    Skionz

    Stacktrace please
     
  3. Offline

    Windy Day

    Is there any errors in the console?
     
  4. Offline

    DevSock

    First of all, you don't even have a command to send to access your code block, but can you show us the error please.
     
  5. Offline

    unon1100

    Send your plugin.yml, and any stacktraces found in the logs.
     
    Adoma_ likes this.
  6. Offline

    Adoma_

    Cant reallt do gamma but can reduce lag to Mineplex grade here try this:
    Code:java
    1. private JavaPlugin _plugin;
    2.  
    3. public MemoryFix(JavaPlugin plugin)
    4. {
    5. this._plugin = plugin;
    6.  
    7. this._plugin.getServer().getScheduler().scheduleSyncRepeatingTask(this._plugin, new Runnable()
    8. {
    9. @SuppressWarnings("rawtypes")
    10. public void run()
    11. {
    12. Iterator localIterator2;
    13. for (Iterator localIterator1 = Bukkit.getWorlds().iterator(); localIterator1.hasNext();
    14. localIterator2.hasNext())
    15. {
    16. World world = (World)localIterator1.next();
    17.  
    18. localIterator2 = ((CraftWorld)world).getHandle().tileEntityList.iterator(); continue;
    19. }
    20. }
    21. }
    22. , 100L, 100L);
    23. }
     
  7. Offline

    DuB_B_O_S

    unon1100

    name: StaticBal
    main: me.staticnetwork.staticbal.StaticBal
    version: 1.0

    commands:
    money:
    usage: /command
    aliases: [bal, balance, money, $]
    permission: StaticBal.bal
    permission-message: You do not have permission to use this command.

    DevSock
    theres no errors. its just not load it it wont show on ./plugins or anywhere....

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

    DevSock

    DuB_B_O_S It has to be telling you something in console if the plugin isn't being loaded, double check.
     
  9. Offline

    DuB_B_O_S

    DevSock

    23.08 14:22:08 [Server] INFO That file is not a valid plugin.
    23.08 14:22:08 [Server] WARN ... 15 more
    23.08 14:22:08 [Server] WARN Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
    23.08 14:22:08 [Server] WARN ... 13 more
    23.08 14:22:08 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:73)
    23.08 14:22:08 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:152)
    23.08 14:22:08 [Server] WARN Caused by: org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    23.08 14:22:08 [Server] WARN at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)
    23.08 14:22:08 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490)
    23.08 14:22:08 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584)
    23.08 14:22:08 [Server] WARN at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:290)
    23.08 14:22:08 [Server] WARN at net.minecraft.server.v1_7_R4.DedicatedServer.aB(DedicatedServer.java:326)
    23.08 14:22:08 [Server] WARN at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchServerCommand(CraftServer.java:753)
    23.08 14:22:08 [Server] WARN at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:767)
    23.08 14:22:08 [Server] WARN at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181)
    23.08 14:22:08 [Server] WARN at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    23.08 14:22:08 [Server] WARN at com.rylinaux.plugman.PlugManCommands.onCommand(PlugManCommands.java:100)
    23.08 14:22:08 [Server] WARN at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:114)
    23.08 14:22:08 [Server] WARN at com.rylinaux.plugman.util.PluginUtil.load(PluginUtil.java:263)
    23.08 14:22:08 [Server] WARN at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329)
    23.08 14:22:08 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:75)
    23.08 14:22:08 [Server] WARN org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml

    i Got an new error

    Code:
    23.08 14:42:16 [Server] WARN ... 20 more
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:73)
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:162)
    23.08 14:42:16 [Server] WARN Caused by: org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:184)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle(PacketPlayInChat.java:65)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.a(PacketPlayInChat.java:28)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:850)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand(PlayerConnection.java:1013)
    23.08 14:42:16 [Server] WARN at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:767)
    23.08 14:42:16 [Server] WARN at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181)
    23.08 14:42:16 [Server] WARN at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    23.08 14:42:16 [Server] WARN at com.rylinaux.plugman.PlugManCommands.onCommand(PlugManCommands.java:100)
    23.08 14:42:16 [Server] WARN at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:114)
    23.08 14:42:16 [Server] WARN at com.rylinaux.plugman.util.PluginUtil.load(PluginUtil.java:263)
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329)
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:75)
    23.08 14:42:16 [Server] WARN org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
  10. Offline

    JordyPwner

    Last edited by a moderator: Jun 9, 2016
  11. Offline

    DuB_B_O_S

    i Fixed it and now i got new Error JordyPwner
    Code:
    23.08 14:42:16 [Server] INFO could not found expected ':'
    23.08 14:42:16 [Server] INFO ^
    23.08 14:42:16 [Server] INFO commands
    23.08 14:42:16 [Server] INFO in 'reader', line 6, column 1:
    23.08 14:42:16 [Server] WARN Caused by: while scanning a simple key
    23.08 14:42:16 [Server] WARN ... 18 more
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:73)
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:162)
    23.08 14:42:16 [Server] WARN Caused by: org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:184)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle(PacketPlayInChat.java:65)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PacketPlayInChat.a(PacketPlayInChat.java:28)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:850)
    23.08 14:42:16 [Server] WARN at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand(PlayerConnection.java:1013)
    23.08 14:42:16 [Server] WARN at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:767)
    23.08 14:42:16 [Server] WARN at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181)
    23.08 14:42:16 [Server] WARN at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
    23.08 14:42:16 [Server] WARN at com.rylinaux.plugman.PlugManCommands.onCommand(PlugManCommands.java:100)
    23.08 14:42:16 [Server] WARN at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:114)
    23.08 14:42:16 [Server] WARN at com.rylinaux.plugman.util.PluginUtil.load(PluginUtil.java:263)
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329)
    23.08 14:42:16 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:75)
    23.08 14:42:16 [Server] WARN org.bukkit.plugin.InvalidPluginException: org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
     
  12. Offline

    JordyPwner

    DuB_B_O_S post your plugin.yml in pastebin
     
  13. Offline

    DuB_B_O_S

    JordyPwner

    Now i got the Plugin.yml Fixed and now the plugin is allowed to load But the plugin is not working ...

    Java Codes:
    Code:java
    1. package me.staticnetwork.staticbal;
    2.  
    3. import java.text.DecimalFormat;
    4. import org.bukkit.Bukkit;
    5. import org.bukkit.command.Command;
    6. import org.bukkit.command.CommandSender;
    7. import org.bukkit.entity.Player;
    8. import org.bukkit.event.Listener;
    9. import org.bukkit.plugin.java.JavaPlugin;
    10.  
    11. public class StaticBal extends JavaPlugin implements Listener{
    12. public void onEnable() {
    13. Bukkit.getServer().getLogger();
    14. }
    15.  
    16. public void onDisable() {
    17. Bukkit.getServer().getLogger().info("StaticBal Plugin Disabled!");
    18. }
    19.  
    20. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    21. if (!(sender instanceof Player)) {
    22. sender.sendMessage("console is not allowed to use balance command!");
    23. return true;
    24. }
    25. double balance = 1234567.89;
    26. DecimalFormat df = new DecimalFormat("###,###,###,###,###.##");
    27. String formattedBalance = df.format(balance);
    28. Player player = (Player) sender;
    29. if (cmd.getName().equalsIgnoreCase("bal")) {
    30. player.sendMessage("Your balance is " + formattedBalance + "!");
    31. }
    32. return true;
    33. }
    34. }



    plugin.yml

    Code:
    name: StaticBal
    main: me.staticnetwork.staticbal.StaticBal
    version: 1.0
     
    commands:
      Balance:
          description: Check your balance
          usage: /bal
          permission: static.bal
          permission-message: You don't have permissio
     
  14. Offline

    JordyPwner

    DuB_B_O_S use this one:

    Code:
    name: StaticBal
    main: me.staticnetwork.staticbal.StaticBal
    author: DuB_B_O_S
    version: 1.0
    description: Static Bal
    commands:
        bal:
            description: main command
            aliases: [bal, balance, money, $]
            permission: StaticBal.bal
            permission-message: You do not have permission to use this command.
     
  15. Offline

    DuB_B_O_S

    ok i will try it now

    JordyPwner Thank you!
    its work now

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

    JordyPwner

    DuB_B_O_S likes this.
  17. Offline

    unon1100

    Why do you implement Listener if you don't have any listeners?
     
  18. Offline

    DuB_B_O_S

Thread Status:
Not open for further replies.

Share This Page