Spoof Commands

Discussion in 'Plugin Development' started by Hunt800, Apr 19, 2012.

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

    Hunt800

    How do I spoof a command to make it seem like it came from the console, or an offline player. More specifically, how can I create an instance of the Command object (so I can use Command.execute()) I see that a child class of Command is PluginCommand, but I need to use it to run a command from a different plugin. Thanks in advance for any help.
     
  2. Offline

    Superkabii

    Code:java
    1. getServer().dispatchCommand(CommandSender sender, String command)
    Example from console:
    Code:java
    1. getServer().dispatchCommand(getServer().getConsoleSender(), "save-all")
    Example from an offline player:
    Code:java
    1. getServer().dispatchCommand(getServer().getOfflinePlayer("Hunt800"), "save-all")
     
  3. Offline

    Hunt800

    Thanks!
     
Thread Status:
Not open for further replies.

Share This Page