Is it possible for one plugin to somehow trigger a command from another plugin?
e.g. I have a plugin that sends a message upon a player typing /msg blabla (using the playerCommandEvent) can I make another plugin trigger that command? I was looking for a method like sendCommand but I couldn't find anything relevant in the API doc.
plugin triggers other plugin command?
-
- English
- Minotorious
- Thread is marked as Resolved.
-
-
Well, basically you can load the second plugin as a lib into your existing plugin project, and then use the plugin.getPluginByID() or plugin.getPluginByName() (or plugin.getAllPlugins()) method to find the particular plugin instance. You could perform a type-cast and access the particular methods of this plugin then, e.g.:
Java -
Interesting...I didn't know you could do that with the API, thanks red
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!