Problem/Bug Help World Bug

Discussion in 'Bukkit Help' started by Blaizerado, Jul 4, 2016.

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

    Blaizerado

    Hey guys I have a problem, and although I try to grade a world to read from a config, but the problem is that I always have the value null get the use

    hear the code of eclipse

    Code:
        public void loadStats() {   
            try {
            FileConfiguration cfg = getConfig();
            double x = cfg.getDouble("sg.top.1.x");
            double y = cfg.getDouble("sg.top.1.x"); 
            double z = cfg.getDouble("sg.top.1.x"); 
            String world = cfg.getString("sg.top.1.world"); 
            y += 1;
            Location loc = new Location(Bukkit.getServer().getWorld(world).getName(), x, y, z);
            System.out.println(loc);
            }catch (Exception e) {
               
            }
        }    

    hear the consol code#

    Code:
    Location{world=null,x=-7.0,y=-6.0,z=-7.0,pitch=0.0,yaw=0.0}

    and hera the config code

    Code:
    sg:
      top:
        '1':
          x: -7.0
          y: 5.0
          z: -2.0
          world: 38565885-a892-4210-aad5-1b9ae8c1e97a
    

    I hope someone can help me
     
  2. Offline

    mc_myster

    @Blaizerado Well the problem is, in your config you have world as "38565885-a892-4210-aad5-1b9ae8c1e97a", is that your world name? if not change it to your world name. Also don't use .getname() after getting the world, if you set the world: as the name then by getting the world that will be returned as the name anyway. Just one last thing, you posted this in the wrong section :p its supposed to be in Bukkit development section. hope i helped!
     
Thread Status:
Not open for further replies.

Share This Page