Solved How would I make a custom chunk generator that creates a layer of barriers at y=1?

Discussion in 'Spigot Plugin Development' started by Xemor, Feb 15, 2020.

  1. Question in the title. Any help?
     
  2. Solved it myself, here's the solution:
    Code (Text):
    public class DuelWorldGenerator extends ChunkGenerator {

        @Override
        @Nonnull
        public ChunkData generateChunkData(@Nonnull World world, @Nonnull Random random, int x, int z, @Nonnull BiomeGrid biome) {
            ChunkData chunkData = createChunkData(world);
            for (int i = 0; i < 16; i++) {
                for (int j = 0; j < 16; j++) {
                    chunkData.setBlock(i, 1, j, Material.BARRIER);
                }
            }
            return chunkData;
        }

    }
     
    • Like Like x 1