how to send command from another plugin?

Discussion in 'Plugin Development' started by JoeMaximum, Feb 5, 2011.

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

    JoeMaximum

    How can i send a command from another plugin, from my plugin?

    For example, i got some function to write in the .yml file to promote someone. After this i would like the permissions to be automaticly refreshed by sending the command "/pr".
     
  2. Offline

    Redecouverte

    if the plugin is using PlayerListener.onPlayerCommand() [the old system]

    you can do :

    Code:
    PlayerChatEvent event = new PlayerChatEvent(Type.PLAYER_COMMAND, player, "/pr");
    this.getServer().getPluginManager().callEvent(event);
    
    for the new system there is no clean way to do it yet
     
  3. Offline

    Joshua Burt

    If the plugin that listens for '/pr' responding to custom events to handle the logic, then you might be able to manually assert the appropriate event for the plugin's listener class from within yours.
     
Thread Status:
Not open for further replies.

Share This Page