Check if plugin is in BungeeCord

Discussion in 'BungeeCord Plugin Development' started by ELPUPAS2015, Dec 3, 2018.

  1. Hello, how i check if plugin is in BungeeCord or is in Spigot?

    I need to do this:
    If plugin is in BungeeCord send a console message: Plugin is in BungeeCord
    If plugin is in Spigotsend a console message: Plugin is in Spigot
     
  2. For checking whether a plugin is in Spigot you can do this:

    Code (Java):
    if (Bukkit.getPluginManager().isPluginEnabled("SomePlugin")) {
               //do something
    }
     
  3. I need to detect if my plugin is on BungeeCord or on Spigot
     
  4. Ok, I'll take a look, thanks
     
  5. If you want to achieve this, you will need two different main classes: one that extends JavaPlugin (for spigot/bukkit) and one that extends Plugin (for bungeecord). Now instead of creating one plugin.yml you will also need to create a bungee.yml with the exact same formatting as a normal plugin.yml.

    Your plugin.yml should redirect to the main class that extends JavaPlugin and your bungee.yml should redirect to the main class that extends Plugin. Keep in mind that most classes from Spigot are unique to the spigot server side and therefore not usable when you are creating a Bungeecord plugin and vice versa.
     
  6. Ok, very thanks for all
     

Share This Page