Index out of bounds error in my code?

Discussion in 'Plugin Development' started by olimoli123, May 4, 2012.

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

    olimoli123

    Hey guys, in my code i get this error:
    java.lang.ArrayIndexOutOfBoundsException: 1
    More detailed error:
    http://pastebin.com/fxwAtQTU

    My code:
    http://pastebin.com/EPYmdRqd

    The line that the errors happen on are:
    Location loc = parseStringToLocation(locString.toString());
    and:
    String[] coords = world[1].split(",");

    The config is set out like this:
    locations:
    SkyBlock2:
    1:-373,63,-274: John

    Any ideas? thanks.
     
  2. Offline

    Whisk

    at com.olimoli123.icraftsmp.iCraftRP.parseStringToLocation(iCraftRP
    :140)
    You have something going on in the iCraftRP class at line 140. Could you paste your whole class?
     
  3. Offline

    olimoli123

    http://pastebin.com/75XeXyZd
    Thanks.
     
  4. Offline

    Sagacious_Zed Bukkit Docs

    You get an IndexOutOfBoundsException when you try to access a non existing element in an array. In this case there is no element at the index 1
     
  5. Offline

    d33k40

    String[] coords = world[1].split(",");

    to:

    String[] coords = world[0].split(",");
     
Thread Status:
Not open for further replies.

Share This Page