Solved Help with dispatchCommand

Discussion in 'Spigot Plugin Help' started by ScenicJaguar101, May 25, 2016.

Thread Status:
Not open for further replies.
  1. Can someone help me code a command in a custom plugin (already have the base like the ifs but need the line that actually makes it run the command) so that it (with dispatchCommand) has it when "/hi" ingame is run, the plugin will have the console run "/say hi" (not have the player say it have the console do it so it sad [Server])

    Please include code how to do that


    EDIT: Changed wording
     
    #1 ScenicJaguar101, May 25, 2016
    Last edited: May 25, 2016
  2. Try this:
    Code (Text):
    ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
    String command = "command";
    Bukkit.dispatchCommand(console, command);
     
  3. Thanks Dan, but that was a while ago. And if I still needed that I see that that would have helped me, just I don't need it anymore...
     
Thread Status:
Not open for further replies.