Chunk IDs?

Discussion in 'Plugin Development' started by Ultimate_n00b, Jun 17, 2013.

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

    Ultimate_n00b

    Are there any way to ID chunks?
    I saw theres a getX and getZ functions in the javadocs, but how do these define a chunk? Is it like a corner of the chunk or what?

    Trying to find a way to save specific chunks in a file..
     
  2. Offline

    CluelessDev


    An (integer) x,z coordinate can only refer to one chunk in a given world. Storing the chunk.getX() and chunk.getZ() would let you refer back to it so you can use the combination of world + coordinate as an ID.

    If you wish to retrieve a chunk at a given x,z coordinate you would use the world's getChunk(x,z) function.

    The X and Z coordinate in themselves define the chunk, because chunks are only measured in integer coordinates. It's like taking a checkerboard, the entire Chunk would be the board and the Blocks would be the spaces, more exact positions would be Locations.
     
  3. Offline

    Ultimate_n00b

    Ah I get it, its like the chunks location in a grid. Thank you.
     
Thread Status:
Not open for further replies.

Share This Page