Help with config paths

Discussion in 'Plugin Development' started by bowlerguy66, Jul 29, 2015.

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

    bowlerguy66

    So the plugin I'm using needs this path from a command

    Code:
    target = Bukkit.getPlayer(args[2]);
    targetuuid = target.getUniqueId().toString();
    
    "Cells." + owns + ".Members." + targetuuid
    In the example above I need the command arguments as a path, so I couldn't get them in this example. So I tried doing this:

    Code:
    String muuid1 = getConfig().getString("Cells." + owns + ".Members.One");
    String muuid2 = getConfig().getString("Cells." + owns + ".Members.Two");
    String muuid3 = getConfig().getString("Cells." + owns + ".Members.Three");
                      
    String member1 = getConfig().getString("Cells." + owns + ".Members.One." + muuid1);
    String member2 = getConfig().getString("Cells." + owns + ".Members.Two." + muuid2);
    String member3 = getConfig().getString("Cells." + owns + ".Members.Three." + muuid3);
    
     
    Last edited: Jul 29, 2015
  2. Offline

    Tecno_Wizard

    @bowlerguy66, java and html/bbcode are 2 different worlds. Lol.

    You need to be more specific on what the issue is rather than "this doesn't work" well, we don't know what "work" is.
     
    Last edited: Jul 29, 2015
    bwfcwalshy likes this.
  3. Offline

    bowlerguy66

    Im trying to msg the player a name in the config. So if they did /member1 they would get the string member1 instead of printing the name, it says null.

    (I also fixed the html part. I don't know what happened :p)
     
  4. Offline

    Tecno_Wizard

    @bowlerguy66, the member fields are overriding the uuid fields. Start there.
     
  5. Offline

    bowlerguy66

    The point of the uuid field was to use it in the member field
     
  6. Offline

    Tecno_Wizard

    @bowlerguy66, when you set a value to a path, if you gave a value to a earlier path (ex assign a.a's value when you have things mapped to a.a.a, a.a.a will be deleted because the further mapped data acts as the value of a.a.
    I really wish I could explain that in a less confusing manner.
     
Thread Status:
Not open for further replies.

Share This Page