Fill area with Certain Blocks

Discussion in 'Spigot Plugin Development' started by OhSry, May 28, 2018.

  1. Hello, I am wanting to fill an area with certain blocks and they will spawn in randomly so each generation will be different, can someone help me please?
     
  2. NathanWolf

    Supporter

    To fill a cuboid with blocks, just make 3 nested for loops. One for x, then y then z. Then call World.getBlockAt(x,y,z).setType(Material.WHATEVER).

    For choosing random blocks, I'd make an ArrayList<Material> and then use a Random, like materials.get(random.nextInt(materials.size()));
     
    • Agree Agree x 1