Disable plugin in certain World

Discussion in 'Plugin Development' started by Cri16228, Sep 15, 2017.

Thread Status:
Not open for further replies.
  1. Hi forum. I'm trying to create a pvp plugin for my server but I need help to enable my plugin only in the world in config.
    Code:
    [...] #other config option
    EnabledWorlds:
    - world
    - pvp
    ecc
    When the plugin is not in one of the world(S) in config I need to "block" the plugin
    There is a kit command and a reward when someone kill a player
     
  2. Offline

    Zombie_Striker

    @Cri16228
    What exactly do you need help with?
    • If you need help getting the worlds from the config, get the Stringlist for "EnabledWorlds", for loop through the list, and call Bukkit.getWorld(String) to get the world instances.
    • If you need help disabling features for your plugin for specific worlds, wherever you add the features, add an if statement before it that checks if the world the feature occurred is in the one of the worlds in the config (best way to do this is store all the worlds in the config inside a List, and then just see if that list contains the world you are testing for)
     
  3. Yes, I simply need something like this:
    Code:
    EnabledWorld:
    - PvP
    - HUB
    
    If you are not in one of this world you can't use kit command or earn the reward for kill
     
Thread Status:
Not open for further replies.

Share This Page