dispatchCommand success message

Discussion in 'Plugin Development' started by stargateanubis14, May 22, 2012.

Thread Status:
Not open for further replies.
  1. For some reason, after i use the dispatchCommand in my plugin, it sends out a message to all players, saying that the command was sent successfully.
    Is there a way to disable this message?
    Code:
    CommandSender console=Bukkit.getConsoleSender();
    plugin.getServer().dispatchCommand(console,"command plus arguments");
    This results with all users seeing a message saying "Command Successfully Sent" in white text in the chat.

    Any ideas?
     
  2. Offline

    SirTyler

    I have been doing getCommad("blah blah").executre(//info here); It does the same task, a little more of a work around but still does it.
     
  3. ok... humor a tired/brain-dead guy...

    If i had a command "/cmd arg1 arg2 arg3", how would that get put into your structure? (sorry... trying to do this waaaaay after my bed time :p )
     
  4. Offline

    SirTyler

    Code:java
    1. getCommand("cmd").exeute(Bukkit.getConsoleSender(), "label", new String[] {arg1, arg2, arg3});
     
  5. hmm... that appears to work under normal circumstances, but it appears to be causing an issue with the command i'm using (a websend command)... it is opening a socket, but for some reason, its erroring out:
    Code:
     [SEVERE] Websend encountered an error while reading from socket.
    org.bukkit.command.CommandException: Unhandled exception executing command 'webget' in plugin ebplug v0.0.1
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:479)
        at Waterflames.websend.CommandParser.onExecuteConsoleCommand(CommandParser.java:145)
        at Waterflames.websend.CommandParser.parse(CommandParser.java:47)
        at Waterflames.websend.ComServer.handleLine(ComServer.java:153)
        at Waterflames.websend.ComServer.run(ComServer.java:96)
    Caused by: java.lang.NullPointerException
        at me.empirebattles.ebplug.CommandHandler.onCommand(CommandHandler.java:54)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40)
        ... 6 more
     
  6. dont call Bukkit methode from another thread excluding the schedular methodes
     
  7. but why would that cause a null pointer exception?

    And im not calling any other bukkit method... i'm just performing a command (the same command that works with a different method)
     
  8. calling a command is an bukkit methode, its unsafe to do it that way
     
  9. well, for what i'm doing, its what i need.
    It works just fine when i simply do the dispatchCommand()... i just do not need all the spam in the chat. (especially since its uncontrollable )
     
  10. Thrad bugs only apper sometimes, are unpredicable and are diffecalt to bedug,and may cause other plugins take the damage from what you have done
     
Thread Status:
Not open for further replies.

Share This Page