Name Cannot Be Validated

Discussion in 'Spigot Plugin Development' started by Zao, Jun 11, 2017.

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


    So, I'm having a issue with Bukkit#getWorld() and I don't understand why.

    Code (Text):

    java.lang.IllegalArgumentException: Name cannot be null
            at org.apache.commons.lang.Validate.notNull( ~[Aethra%
            at org.bukkit.craftbukkit.v1_8_R3.CraftServer.getWorld(
    1014) ~[Aethra%20Spigot.jar:git-Spigot-e4d4710-e1ebe52]
            at org.bukkit.Bukkit.getWorld( ~[Aethra%20Spigot.jar:git
            at me.zao.cheststuff.CHESTSTUFF.loadChests(
            at me.zao.cheststuff.CHESTSTUFF.<init>( ~[?
            at me.zao.cheststuff.CS.onEnable( ~[?:?]
    The code where that line is this:

    Code (Text):
     Location loc = new Location(Bukkit.getWorld(_c.getString(path + "")), _c.getInt(path + ".loc.x"), _c.getInt(path + ".loc.y"), _c.getInt(path + ".loc.z"));
    The config line where that is is this:
    Code (Text):

        type: '1'
        id: 1
          world: world_nether
          x: -60
          y: 58
          z: -427
  2. Is the ".loc." supposed to be there?
    And please, name your classes appropriately, not with all caps.
  3. Try printing out the location to console. See what it is trying to retrieve. Is the path correct?
  4. It'd make sense to, looks most likely to be a wrong path before the ".loc."
  5. Ohh, I see, I didn't notice the "path+" in front. It most likely is so. Try printing the values in a sysout to see if they are null.
  6. Already suggested :p; it is most likely a wrong path, we'll see when the OP tests
    • Winner Winner x 1
  7. Zao


    Was a issue on my config, I looked over it and there was some names defined but no world defined for that name. Thanks.
Thread Status:
Not open for further replies.