Solved How to add and remove keys in config.yml?

Discussion in 'Plugin Development' started by gogobebe2, Jan 12, 2015.

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

    gogobebe2

    Im making an arena plugin where the admin can create multiple arena and store the data in config.yml. If an admin types /dueladmin create "arena name", it should generate a branch of text like the following code and when they type /duel admin setplayerpos1 "arena name" "set that part of it."
    I want the config to look like this:
    Code:
    Arena Names:
      arena1:
        pos1:
          x: 12
          y: 50
          z: 123
        pos2:
           //nothing until it is set
        inventory: "some item stack thing"
      anotherarena:
        pos1:
        etc...
    I looked at this page:
    http://wiki.bukkit.org/Configuration_API_Reference
    Except I don't understand what it is telling me about keys and hashmaps.
    I how do I store data like this in config.yml?

    Also I want to know if there is a way to remove the whole group. like /dueladmin remove arena1

    Any idea how I would go about doing this? I would suspect I might use multi-dimensional arrays possibly?

    Solved.

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

Share This Page