Create a 3x3x3 whole every 10 blocks

Discussion in 'Plugin Development' started by MooshViolet, Dec 9, 2014.

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

    MooshViolet

    Hi there. I was wondering how to create a 3x3x3 whole with a piece of glowstone in the middle of that whole every 10 blocks.
     
  2. Offline

    TheCodingCat

    Look into world edit API and/or Cube regions
    @MooshViolet
     
  3. Offline

    MooshViolet

    @TheCodingCat
    Is there not any easier way?

    I can't think of a way to make it so it skips every 10 blocks then makes a 3x3x3 hole by setting it to air, then going another 10 blocks then making another 3x3x3 hole, etc.
     
  4. Offline

    TheCodingCat

    Location#add
    Location#remove
    ????
     
  5. Offline

    MooshViolet

  6. Offline

    Skionz

  7. Offline

    MooshViolet

    @Skionz
    Call me an idiot and slap me hard but I have already read through that a hundred times but which one should I use to just simply get every 10 blocks
     
  8. Offline

    mythbusterma

    @MooshViolet

    Something like:

    Code:
    Location startLocation;
    
    for(int i = 0; i < somenumber; i+=10) {
       setBlocksAround(startLocation.getWorld().getLocationAt(x,y,z+i));
    }
    
    
    With setBlocksAround being a method that surrounds a location with glowstone.
     
  9. Offline

    MooshViolet

    @mythbusterma
    Well the intent was to make a 3x3x3 hole with one piece of glowstone in the center
     
  10. Offline

    mythbusterma

  11. Offline

    MooshViolet

    @mythbusterma
    so here is the code:
    Code:
            Location startLocation;
    
            for(int i = 0; i < 4096; i+=10) {
               setBlocksAround(startLocation.getWorld().getLocationAt(x,y,z+i));
            }
    So I am getting an error saying getLocationAt is "undefined for the type world"
     
  12. Offline

    mythbusterma

    @MooshViolet

    Yea....I messed that up, treat it as pseudocode.
     
  13. Offline

    MooshViolet

  14. Offline

    mythbusterma

    @MooshViolet

    Create a for loop that iterates over ten blocks, then create a hole there.
     
  15. Offline

    Skionz

    @MooshViolet He gave you pseudocode. The point of pseudocode is to tell you what to do without actually doing it for you. I am positive you can find everything you need on the Javadocs.
     
  16. Offline

    MooshViolet

    @mythbusterma Thats the problem, I do not know how to create a loop that iterates over ten blocks.
     
  17. Offline

    Skionz

  18. Offline

    MooshViolet

    @Skionz
    I know java dude. I simply am stuck on creating an actual hole in the ground after the 10 blocks.
     
  19. Offline

    mythbusterma

  20. Offline

    MooshViolet

    @mythbusterma
    Well. I wouldn't have made a thread if it sounded that easy to me
     
  21. Offline

    mythbusterma

  22. Offline

    MooshViolet

    @mythbusterma
    I need more help than what I already know. i need to know how to delete it in a 3x3x3 square
     
  23. Offline

    mythbusterma

    @MooshViolet

    Get the Block at a location, set it to air, then move in a circle.
     
  24. Offline

    MooshViolet

    Ok I think I almost got it, how do I move it in a circle?
     
  25. Offline

    mythbusterma

  26. Offline

    MooshViolet

  27. Offline

    mythbusterma

    @MooshViolet

    You haven't provided any context at all. Why is this so difficult? I've told you how to get a location, and someone else has demonstrated what a for-loop is. Just put them together.
     
  28. Offline

    MooshViolet

    @mythbusterma
    I appreciate the help, but I want that for everywhere around the world, not just a specific location that I will have to specify over and over again.
     
  29. Offline

    Rocoty

    @MooshViolet Do it on chunk load. Iterate over the blocks in the chunk loaded.
     
  30. Offline

    MooshViolet

    @Rocoty
    Have never really messed with the chunks, how would I do that?

    @Rocoty
    Should I do the event?

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

Share This Page