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

YML help, skipping middle attribute [SOLVED]

Comments in 'Plugin Development' started by WillotheBlessed, Sep 21, 2014.

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

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Code:
    17:57:37 [NOTICE] An E_NOTICE error happened: "Undefined index: Y" in "/Spawner_v_1/src/Spawner/SpawnerMain" at line 29
    17:57:37 [INFO] [Spawner] Test Message: Spawn1:  (X: -786, Y: , Z: -156)
    
    When I try to read this YML document, it skips the middle attribute. It even does this on a loop of all 4 spawns. Needless to say, it also skips the "Player" attribute, which I assume is because it's just skipping every other one. But why?

    Code:
    Spawn1:
    X: -786
    Y: 4
    Z: -156
    Player:
    Spawn2:
    X: -786
    Y: 4
    Z: -190
    Player:
    Spawn3:
    X: -786
    Y: 4
    Z: -124
    Player:
    Spawn4:
    X: -786
    Y: 4
    Z: -93
    Player:
    
    Last edited: Sep 21, 2014
    LDX likes this.
  2. WillotheBlessed
    Offline

    WillotheBlessed Active Member

    Joined:
    Sep 17, 2014
    Posts:
    69
    Minecraft User:
    will
    Ok, it turned out to be a simple error I tracked down with an online YML validator here: http://wiki.ess3.net/yaml/

    Some validators will allow my above YML, but this one will not. Coincidentally the YML validator inside Pocketmine is throwing the same errors. This was my new YML sheet, the one that read. The only difference is I had to add to the YML keys so they were longer than one character in length.

    Code:
    Spawn1:
     sX: -786
     sY: 4
     sZ: -156
     Player:
    Spawn2:
     sX: -786
     sY: 4
     sZ: -190
     Player:
    Spawn3:
     sX: -786
     sY: 4
     sZ: -124
     Player:
    Spawn4:
     sX: -786
     sY: 4
     sZ: -93
     Player:
    
Thread Status:
Not open for further replies.

Share This Page

Advertisement