Loading of items from a config

Discussion in 'Plugin Development' started by TheBlack.Z, Jan 23, 2015.

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

    TheBlack.Z

    I need to make loading items from the config that is, when adding a new item and restarting the plugin automatically adds new item.

    Here is an example config
    Code:
    Items:
       Iron:
          Name: 'test'
          Lore: test
    And this modified config which has 2 items and how to make so that both of them were loaded?

    Code:
    Items:
       Iron:
          Name: 'test'
          Lore: test
       Iron2:
          Name: 'test2'
          Lore: test2
     
    Last edited: Jan 23, 2015
  2. @TheBlack.Z What do you mean exactly? If they add a lore set something in config?
     
  3. Offline

    TheBlack.Z

    I apologize for my English, not really own it at the professional level.
    I need to make downloading items from the config ie when adding a new item, it after restarting the plugin automatically adds Be it kraft or something else
     
  4. Offline

    Skionz

  5. Offline

    TheBlack.Z

    made so that you could understand what I want
     
  6. Offline

    Skionz

    @TheBlack.Z Use YamlConfiguration.loadConfiguration(File)
     
  7. Offline

    TheBlack.Z

    and such as to make delivery of item through command?
     
  8. Offline

    LegacyGaming

    Think you might be looking for this:
    Code:
    for(String Item : this.getConfig().getConfigurationSection("Items").getKeys(false)) {
    return Item;
    }
    That should return "Iron" and "Iron2".
     
    Last edited: Jan 23, 2015
Thread Status:
Not open for further replies.

Share This Page