Plugin help

Discussion in 'Plugin Development' started by Dezarith, Sep 9, 2011.

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

    Dezarith

    ok so im new bukkit this is my first plugin im getting this error

    Code:
    09:56:17 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'rage
    quit' in plugin RAGE v1
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:12
    9)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:3
    20)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:713)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.Error: Unresolved compilation problem:
            Syntax error, insert ") Statement" to complete IfStatement
    
            at me.dezarith.ThisBin.ThisBin.onCommand(ThisBin.java:22)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more

    This is the source:

    Code:
    package me.dezarith.ThisBin;
    
    import java.util.logging.Logger;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class ThisBin extends JavaPlugin {
    private static final Logger log = Logger.getLogger("Minecraft");
    
        public void onDisable() {
        }
    
        public void onEnable() {
            log.info("[RAGE IS UP");
            }
      public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
            Player player = (Player) sender;
            if (commandLabel.equalsIgnoreCase("ragequit"));
            player.kickPlayer(commandLabel);
            System.out.println("[RAGE] " + player.getDisplayName() + "HAS RAGE QUIT! ");
            getServer().broadcastMessageplayer.getDisplayName() + HAS RAGEQUIT!!!());
            return false;
    }
    
    }

    No idea what the problem is anyhelp would be apreciated.
    What it does: Allows you to type /ragequit it kicks you then broadcasts a message.
    Bukkit recognizes it as a plugin when i type /ragequit it doesnt work.


    1. OS: Windows 7
    2. Architecture: 64bit
    3. Wrappers :none
    4. Build 1060

    Thanks, Dez
     
  2. Offline

    stelar7

    You might want to learn java before you do this...

    ALSO,

    Fixed it for you...
    Code:java
    1. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
    2. Player player = (Player) sender;
    3. if (commandLabel.equalsIgnoreCase("ragequit")) {
    4. player.kickPlayer("You Ragequit!");
    5. System.out.println("[RAGE] " + player.getDisplayName() + " HAS RAGE QUIT! ");
    6. getServer().broadcastMessage(player.getDisplayName() + " HAS RAGEQUIT!!!");
    7. return true;
    8. }
    9. }
     
  3. Offline

    Dezarith

    Thanks and i know a little java so..

    Actually no ya didnt you just gave me this error:
    (The same on again)
    Code:
    12:47:49 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'rage
    quit' in plugin RAGE v1
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:12
    9)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:3
    20)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:713)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.Error: Unresolved compilation problem:
            Syntax error, insert ") Statement" to complete IfStatement
    
            at me.dezarith.ThisBin.ThisBin.onCommand(ThisBin.java:22)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  4. Offline

    nisovin

    How are you compiling your plugin? It shouldn't even be letting you compile it. You obviously didn't even compile it again the second time, because that's the exact same error from before, but the code has changed.
     
  5. Offline

    Dezarith

    Via exporting it and adding plugin.yml
     
  6. Offline

    stelar7

    Use eclipse...
     
  7. Offline

    Dezarith

    Also still get the error with no other plugins.

    Using eclipse

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

    stelar7

  9. Offline

    Dezarith

    Read the entire thing yes
     
  10. Offline

    stelar7

    NO, F**KING WAY!

    Looking at your code, if you set up Eclipse correctly, you should not be able to export the plugin....
     
  11. Offline

    nisovin

    Do you not see the compile errors in your code? No red underlines? You shouldn't be attempting to export your plugin if you have errors in your code. It's possible your eclipse is not working correctly.
     
  12. Offline

    stelar7

    Even if he did attempt, Eclipse shouldn't allow him to export it... (Personal experience)
     
  13. Offline

    Dezarith

    Yeah rebooted eclipse about a 100 red underlines that i didnt have before.
     
  14. Offline

    nisovin

    Actually, it will allow you to export a jar, even if the project doesn't compile.
     
  15. Offline

    Dezarith

    And yes it allows me to export it.
     
  16. Well then you should...*facepalm*
     
  17. Offline

    stelar7

    I can't :p

    Fix them? :cool:


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  18. I can :confused:
     
  19. Offline

    stelar7

    When I try to export it, I get an popup saying that "There are errors in your project "project name here". Do you want to continue"... If i continue it (the plugin) doesn't work (Obviously). Unless i fix the errors ofc :p
     
  20. It still exports if you hit okay though ;)
     
  21. Offline

    stelar7

    Yeah, but it won't work :)
     
  22. Offline

    nisovin

    Of course it won't. It will throw the exact kind of error the OP was getting. Which was my point when I mentioned it.
     
  23. Offline

    stelar7

    So, have OP fixed his problem now?
     
  24. probably not :D
     
  25. Offline

    Dezarith

    Yeah im fixing the errors and *facepalm* is right :(

    But does eclipse not update the errors until a reboot or what?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  26. Offline

    stelar7

    Should be real time updates...
     
Thread Status:
Not open for further replies.

Share This Page