Setting Blocks in a Area

Discussion in 'Plugin Development' started by scarabcoder, Jan 30, 2014.

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

    scarabcoder

    Hey guys,
    I am trying to make a minigame, and I want to be able to have water 'rise'. But my biggest problem is, how do I get two locations and have it generate blocks between those to locations? I know it will take some sort of loop, but I really have no idea.
    Also, it would be much easier for me if you could post the code as a method, like setBlocks(world, loc1, loc2, material). Thanks,
    Scarabcoder
     
  2. Offline

    bfgbfggf

    Code:
                    for (int x = minx; x <= maxx; x++) {
                        for (int y = miny; y <= maxy; y++) {
                            for (int z = minz; z <= maxz; z++) {
                                //set block
                            }
                        }
                    }
    maybe that?
     
  3. Offline

    scarabcoder

    I think that might work.... Could you give me the code for, say, if I wanted to set water between (12, 13, 15), and (17, 15, 20)?

    Nevermind, I got it now.
    You, sir, are AWESOME. :)
    bfgbfggf

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
Thread Status:
Not open for further replies.

Share This Page