YamlConfiguration list values?

Discussion in 'Plugin Development' started by Meatiex, Jan 18, 2015.

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

    Meatiex

    How would I list all the values in a config file?

    I want to get all the homes a player has set and tell them, for example the code below would return this: (When ran by Meatie)
    home, sos, 1
    Code:
    Meatie:
      home:
        world: plotworld
        x: -24.301889304921335
        y: 70.0
        z: 5.594483475762379
        yaw: -253.05048
        pitch: 17.100052
      sos:
        world: plotworld
        x: -22.94186577940271
        y: 65.0
        z: 0.04391178204817245
        yaw: -272.70047
        pitch: 11.550053
      '1':
        world: plotworld
        x: -150.31789195691587
        y: 23.0
        z: 134.91297961438454
        yaw: -113.24985
        pitch: -11.700105
    
     
  2. Offline

    Skionz

    @Meatiex Read through the Javadocs and I am sure you will find your answer.
     
    teej107, Meatiex and Dragonphase like this.
  3. Offline

    Meatiex

    I don't mean to be rood, but do you dwell these forums with the intention bugging people?
    It seems like you enjoy shunning everyone you can over to the javadocs.
    Sorry to say, but when you do it makes you seem a little like a "smart ass"

    FYI:
    Maybe I already checked the javadocs and did a lot of searching?
    Do you think I would post a question here just to bug people? Well the answer is no, I posted the question because I truly couldn't find the answer.

    If you want me to respond like the average amateur to java i'll say:
    "I don't get it, wheres the code at?"
    And you'll probably respond:
    "This ain't no spoon feeding community" (Think about it, would you again sound like a "smart ass"?)

    Definition from Google:
    Code:
    smart-ass: a person who is irritating because they behave as if they know everything.
    Tell me, do you think you sound like a "smart ass" saying what you said?

    Thank you for taking your valuable time to read my response, I hope you learned something reading it. (slight sarcasm)
     
    Skionz likes this.
  4. Offline

    Skionz

  5. Offline

    Meatiex

    @Skionz
    bukkit.org is considered the javadocs? I didn't know that, Thank you for
    letting me know.
    Also I'm sorry for not searching well
    enough. Thank you for you'r response. It was very helpful.
     
    Skionz likes this.
  6. Offline

    Flamedek

    @Meatiex
    While you now have a ton of examples of iterating through the files, that's not exactly what you need.
    You just need the getKeys(false) method of ConfigurationSection.


    EDIT: nvm that's what most examples show. /facepalm
     
    Meatiex likes this.
Thread Status:
Not open for further replies.

Share This Page