How can I fill a large area of blocks

Discussion in 'Plugin Development' started by darthvader1925, May 3, 2021 at 10:45 AM.

  1. Offline

    darthvader1925

    I am trying to fill an area with air, then replace it back to stone after a bit. Like a door. I figure there is a way to loop through the area in the whole area but I'm not sure. How can I do that or is there another way?
     
  2. Offline

    davidclue

  3. Offline

    Kars

    1. Have parameters, like a double set of coordinates that represent the to and from;
    2. In your code, loop through each location within your range;
    3. For each location, create a Location(world, x, y, z) and use Location#getBlock to get the block;
    4. Set it to air or stone or whatever;
    5. Schedule a delayed task and repeat above steps to set it back to he desired block type;
    https://riptutorial.com/bukkit/example/19376/scheduler-delayed-task
     
  4. Offline

    darthvader1925

    Ok, I'll test it out later
     

Share This Page