Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Config

Comments in 'Plugin Development' started by TheMaks, Nov 2, 2015.

  1. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    How to make a config like this?
    Code:
    player:
     effect:
      - Speed:
         duration: 2
         amplifier: 60
     message:
      - "You got affect"
  2. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    Make a config or get config?
    Explain better if you want be helped.
  3. TonyDroide
    Offline

    TonyDroide Active Member Plugin Developer

    Joined:
    Jun 5, 2015
    Posts:
    122
    Plugins:
    1
    Minecraft User:
    TonyDroidd
    PHP:
    $this->getConfig()->get("Effect");
  4. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    yaml.PNG
    So simple. Why not do that yourself?
  5. Wuros
    Offline

    Wuros New Member

    Joined:
    Sep 12, 2014
    Posts:
    8
    Minecraft User:
    Wuros
    Use PocketMine YAML Config class
  6. TheMaks
    Offline

    TheMaks Active Member

    Joined:
    Jul 19, 2015
    Posts:
    58
    Minecraft User:
    TheMaks
    How get this ?
    PHP:
    $this->config->get("player")["effect"];
  7. Wuros
    Offline

    Wuros New Member

    Joined:
    Sep 12, 2014
    Posts:
    8
    Minecraft User:
    Wuros
    What?
  8. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    I had similar problem with this. I'm not quite sure, but getnested? TBH, despite the fact that I asked this millions times, I am still not sure how to get
    Code:
    item:
      stuff:
        anotherstuff:
          - 9
    
    Returns 9
  9. CrazedMiner
    Offline

    CrazedMiner Notable Member Plugin Developer

    Joined:
    Jan 31, 2015
    Posts:
    348
    Plugins:
    2
    Minecraft User:
    CrazedMinerYT
    PHP:
    $this->config->getAll()["item"]["stuff"]["anotherstuff"];
    The YAML file extension can be seen as storing arrays to a file.
    minebuilder0110 likes this.
  10. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The Config class is not specific to YAML. You can also use it with other formats, such as JSON.
    CrazedMiner likes this.

Share This Page

Advertisement