Need Help Using PluginManager

Discussion in 'Plugin Development' started by ImAFlo, Jan 8, 2015.

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

    ImAFlo

    Hi,

    I have two questions regarding the use of the plugin manager.
    How can I disable / enable another plugin? this.getServer().disablePlugin("<Name>"); don't work

    And how can I args [1] to convert type plugin?



    Thanks in advance
     
  2. hope this will help :)

    Code:
            //define the plugin by name
            Plugin plugin = Bukkit.getPluginManager().getPlugin("pluginname");
            //disable the plugin
            Bukkit.getPluginManager().disablePlugin(plugin);
            //enable the plugin
            Bukkit.getPluginManager().enablePlugin(plugin);
    
    convert args[1] to type plugin would look like this
    Code:
            String s = args[1];
            Plugin plugin = Bukkit.getPluginManager().getPlugin(s);
    
     
    Last edited by a moderator: Jan 8, 2015
Thread Status:
Not open for further replies.

Share This Page