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 PalkiaDudeYT, Nov 9, 2015.

  1. PalkiaDudeYT
    Offline

    PalkiaDudeYT New Member

    Joined:
    Aug 30, 2015
    Posts:
    33
    Minecraft User:
    PalkiaDude
    How do I get data for a world and position?
  2. andre_the_gamer
    Offline

    andre_the_gamer Active Member

    Joined:
    Feb 5, 2015
    Posts:
    112
    Minecraft User:
    Andre_The_Gamer
    You can get things from a config, Just use this:
    PHP:
    $this->getConfig()->get("AnyThingHere");
    Last edited: Nov 9, 2015
  3. Praxthisnovcht
    Offline

    Praxthisnovcht Notable Member Plugin Developer

    Joined:
    Mar 10, 2014
    Posts:
    699
    Plugins:
    4
    Minecraft User:
    PraxHellTag
    PHP:
                "position" => [
                    
    "x" => $x,
                    
    "y" => $y,
                    
    "z" => $z,
                    
    "level" => $level
                
    ],
                
    "data" => $data
  4. ItsSuka
    Offline

    ItsSuka Banned

    Joined:
    Nov 6, 2015
    Posts:
    13
    Minecraft User:
    Unknow
    Code:
    $level->getLevelByName("world");
  5. hoyinm14mc
    Offline

    hoyinm14mc Notable Member Plugin Developer

    Joined:
    Jun 4, 2014
    Posts:
    501
    Plugins:
    9
    Minecraft User:
    hoyinm14mc
    Save it like this:
    Code:
    pos:
      x: 1
      y: 2
      z: 3
      world: lobby
    
    To get them,
    PHP:
    $data = new Config($this->getDataFolder()."position.yml"Config::YAML, array());
    $tmp $data->getAll();
    $x = (int) $tmp["pos"]["x"];
    $y = (int) $tmp["pos"]["y"];
    $z = (int) $tmp["pos"]["z"];
    $level Server::getInstance()->getLevelByName($tmp["pos"]["world"]);
    Vaivez66 likes this.

Share This Page

Advertisement