run a command

Discussion in 'Plugin Development' started by Gator96100, Mar 12, 2012.

Thread Status:
Not open for further replies.
  1. Hello,
    I've a question.

    How I can run any Command like "pay player" or "weather rain" ?
     
  2. Offline

    WaffleOnABike

    I am wondering this too, like if a player types something if you create a command /house it will send a command different like /warp house.
     
  3. I know that warps doesen't work because the plugin runs the command not the player.
    I only want to know how I can run a command like /kick someone or /money give someone
     
  4. Offline

    WaffleOnABike

  5. Thx
    But can you give me one example pls?
     
  6. Offline

    WaffleOnABike

    Let's say I want to do /warp house, would this work:

    How would I add that with getPluginCommand ()?
     
  7. Offline

    Father Of Time

    Click "search", click "advanced search", enter "onCommand" and select the plug-in development forum from the list of available boards to search. If you do as stated above you will find dozens upon dozens of code samples for creating commands.
     
  8. Doesen't helped me.
    I already created a command.
    I want to know how i can run a command that isn't created by my plugin.
     
  9. Offline

    Father Of Time

    I don't believe you can, I think you would be better off calling what ever functions that plug-ins command is calling if their API exposes it, because trying to call another plug-in's functionality from it's command handlers sounds very hackish...
     
  10. I just want to run a command throw the console
     
  11. Offline

    Waterflames

    Console command:
    Code:java
    1. ConsoleCommandSender ccs = server.getConsoleSender();
    2. server.dispatchCommand(ccs, "command");


    Player command:
    Code:java
    1. server.dispatchCommand(player, "command");


    That wasn't that hard, was it ;)
     
    WaffleOnABike likes this.
  12. Thx that was exactly what I'm looking for.
     
  13. Offline

    WaffleOnABike

    Your a boss.
     
Thread Status:
Not open for further replies.

Share This Page