How to cancel the loading of a plugin?

Discussion in 'Plugin Development' started by DjDCH, Jan 19, 2011.

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


    I'm facing this issue since I notice error can occur in the loading process and I want, when this occurred, stop the loading process of the plugin. I don't know if this already possible with bukkit, but it would be nice to have the possibility to do it. So, how to cancel the loading of a plugin?
  2. Offline


    I'm not sure if you can cancel the loading, but you can try to disable it again via the Pluginmanager.

  3. Offline


    Forgot to say that I have already try this. When you are in the loading process, this mutator have no effect.


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 6, 2016
  4. Offline


    I just took a look to the CraftBukkit code to see how a plugin is enable. Since the way the onEnable method is called, there no possibilities to do what I need to do.

    So, I request the implementation of a way to cancel a plugin from the onEnable method (like a specific exception to throw, a setCancelled mutator or a true/false boolean to return).
  5. Offline


  6. Offline


  7. Offline

    Tahg Retired Staff

    Let me clarify here. You want to disable your own plugin, if for some reason it fails to properly initialize? This seems like a logical thing to do and we can look into it. We will NOT however provide a mechanism to prevent the loading of other plugins if it is that that you want to do.
  8. Offline


    This. Like I said, I need a way, from inside the onEnable method, to cancel a plugin from finishing its loading. I was thinking about a specific exception to throw, and I'm pretty convince that is the best way to do it.
  9. Offline

    Tahg Retired Staff

    Thanks for the clarification. I will bring this up with the team, but it sounds reasonable to me.
  10. Offline


    Look at how MMA or MMS disables itself if MMC is not installed.
  11. Offline


    *Facepalm* While I was took a look to the CraftBukkit code, I had seen this method (setEnabled) but I don't realized that is what I've searching for. I will try it soon.

    Thanks Afforess ! :D
Thread Status:
Not open for further replies.

Share This Page