Solved How to get the default gamemode for world?

Discussion in 'Plugin Development' started by AnorZaken, Oct 26, 2013.

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

    AnorZaken

    Writing a plugin and I need to get what the default gamemode is for a world, is this possible in "vanilla"? What method would I use to get it? (tried searching for ~1h but didn't find the answer :/ )

    Perhaps this is only possible if one uses something like multiverse? (What method?)
    ...but on a single world server surely it should be possible somehow even in vanilla? (What method?)

    (Just to avoid confusion: I'm writing code, I want methods / docs, not chat-commands!)
     
  2. Offline

    qhenckel

    so there is Server.getDefaultGameMode () but not sure how that works for a world.
    Can you even have more than one world in vanilla bukkit?
     
    AnorZaken likes this.
  3. Offline

    AnorZaken

    Thanks for the info @qhenckel :) Will give it some thought and possibly look more at Multiverse.

    I want to mark this as solved, so fleshing out the answer a bit for multiverse.
    These links (in this order) should get you going:
    *there might be a better way, and I haven't actually tested this so please comment if it's wrong

    https://forums.bukkit.org/threads/multiverse-worldmanager-api.94746/

    ** http://ci.onarandombox.com/job/Multiverse-Core/doxygen/ **
    http://ci.onarandombox.com/job/Mult...1_core.html#a287282eac64a69fcdbb045ad2197266a
    http://ci.onarandombox.com/job/Mult...ltiverse_core_1_1utils_1_1_world_manager.html
    http://ci.onarandombox.com/job/Mult...anager.html#af107eb71ed725506fc50af8de7335a84
    (try cast to...)
    http://ci.onarandombox.com/job/Mult...dombox_1_1_multiverse_core_1_1_m_v_world.html
    http://ci.onarandombox.com/job/Mult..._world.html#a11af450ecf6cdf213197535457ea9fbc

    (because documentation links are better than actual code in my opinion)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 5, 2016
Thread Status:
Not open for further replies.

Share This Page