Trouble in config

Discussion in 'Plugin Development' started by TerroDoor, Nov 30, 2019.

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

    TerroDoor

    My config looks like so:

    Player name:
    Kills:
    Deaths:
    Money:

    I’m trying to access the players money string, what is the correct way of doing so? I tried using getConfig.getint(p.getname() + “.money”);

    Thanks for your time


    Sent from my iPhone using Tapatalk
     
  2. Offline

    yPedx

    @TerroDoor
    Assuming your config looks like this;
    Code:
    Player name:
        Kills:
        Deaths:
        Money:
    Then what you tried was correct.
     
    Last edited: Nov 30, 2019
    TerroDoor likes this.
  3. Offline

    robertlit

    The 'M' must be upper case (if it is in the config)
     
    TerroDoor likes this.
  4. Offline

    KarimAKL

    It should be:
    Code:Java
    1. getConfig().getInt(p.getName() + ".Money")

    What i changed:
    getint() -> getInt()
    getname() -> getName()
    ".money" -> ".Money"

    Btw, i'd recommend using UUIDs instead of player names. (Names can change, UUIDs can't)
     
    TerroDoor likes this.
Thread Status:
Not open for further replies.

Share This Page