Solved Have Plugin Load From Custom Directory

Discussion in 'Spigot Plugin Development' started by ReadySetPawn, Jul 31, 2015.

  1. So I was looking through the docs and I noticed that the JavaPluginLoader class has a loadPlugin(File file) method. Does this mean that I can load a plugin on my server without it being in the plugins folder? The only reason I can think of that might prevent this from working is the plugin's dependency for Spigot/Bukkit.
    Thoughts?
     
    • Like Like x 2
  2. What does the description of it say on the JavaDoc.
     
    • Like Like x 1
  3. "Loads the plugin contained in the specified file"
     
  4. Yes it attempts to load whatever file you inputted, I used this before so I could have one plugin on every server then load from a seperate folder whatever that server needed.

    So I would have a directory called /plugins/hub/ And the plugin would get the server name and load all the plugins in /hub/ folder.

    It's pretty useful to have to only update one plugin in one place.
     
  5. That's amazing :eek: I was so interested in the method because of that very reason. Thank you very much!
     
  6. So would it be loadPlugin(*path to file here*\something.jar);???
     
  7. Yep