Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How To make my plugin work for certain world

Comments in 'Plugin Development' started by amiremad, Nov 2, 2015.

  1. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    i wont to add a config.yml and in it i can type the world name and done the plugin will only be used on the world i want

    please give me a code guide

    because i want to that in alot of my plugins but i dont know how

    if i am going to register an event or something please specify in code
  2. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    Do you want to enable/disable only your plugin in certain worlds or all plugins?
  3. Radguy23
    Offline

    Radguy23 Active Member

    Joined:
    Aug 14, 2015
    Posts:
    74
    Minecraft User:
    TheAwesomeCrew27
    Yes that was he is asking.
  4. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    only my plugin
  5. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    i want to enable it for certain world and desable it for the other worlds please give me a code
  6. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    This question has been asked so many times...
    Anyways, I dont know if its possible to "enable" a plugin per world, since all plugins are enabled on the server startup. Within your plugin u can simply check the world the player is in, and if it is your desired world, the plugin does what its supposed to do. If its not your desired world then cancel whatever its supposed to do.
  7. EvolSoft
    Offline

    EvolSoft Notable Member Plugin Developer

    Joined:
    Sep 10, 2014
    Posts:
    821
    Plugins:
    15
    Minecraft User:
    Flavius12
    If you want to enable/disable just your plugin you can add an if block on each command and event which checks the world were the player is and execute the event or the command if the player is on a specific world.
    If you want to disable/enable other plugins "per world" I think there is not a direct way but you can do some things.
    For example you can modify the source code of the plugin (Easiest and Working way)
    If you want to do something bigger instead you can create an API which other plugins must use (Difficult and not always working way. Don't forget that plugins must use that API in order to work correctly)
  8. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Or if you are not very develop-y, try permissions
  9. amiremad
    Offline

    amiremad Active Member

    Joined:
    Sep 8, 2015
    Posts:
    192
    Minecraft User:
    amir107
    look it is like mcgenius did the spleef plugin doesnt work only in the world i type its name

Share This Page

Advertisement