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

Solved How to set a list in a YAML config?

Comments in 'Plugin Development' started by Lexo, Apr 6, 2016.

  1. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    I need to create config like that:

    Code:
    Name:
    - Item1
    - Item2
    - Item3
  2. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    Where? I didn't found anything -_-
  3. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Config::set() or Config::setNested(). For the list, take a look at this.
    Lexo likes this.
  4. Lexo
    Offline

    Lexo New Member

    Joined:
    May 25, 2015
    Posts:
    19
    Minecraft User:
    Lexo
    Thanks. Another question: I already have that config, and I must change only Item2. Of cuuse that ( $conf->__set("d", array[2]("Item2_changed")) ) not working :p
  5. AndrewBit
    Offline

    AndrewBit Notable Member

    Joined:
    Jun 18, 2015
    Posts:
    435
    Minecraft User:
    AndrewBit4
    Sorry, I send an uncomplete post by error!

    Try using:
    PHP:
    $conf->set('Array'[1], $value);
    Lexo likes this.
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    __set() is a magic method. Don't use it directly. We are talking about Config::set(), not Config::__set().
    CraftYourBukkit likes this.

Share This Page

Advertisement