2

I'm currently working on a spigot server plugin and I want to modify the default world generator so that every chunk is made out of one random block. I heard that you can make a custom world generator but I only want to modify the default one. Is there any way to do that? Thanks in advance!

1 Answers1

3

You should use WorldCreator like that:

new WorldCreator("myWorld").environment(Environment.NORMAL).generator(new MyGenerator()).createWorld();

Then, create the class MyGenerator which should extend ChunkGenerator like that:

public class MyGenerator extends ChunkGenerator {

   // here define all methods from "ChunkGenerator" class like:
   @Override
   public boolean shouldGenerateCaves() {
       return false;
   }
}

You can change some configuration in the world creator, specially the name or the seed. Else, you should config other things in the MyGenerator's class.

Elikill58
  • 4,050
  • 24
  • 23
  • 45
  • Oh and how can I do something like the setRegion method of the chunk data class? – Johannes Becker Feb 17 '22 at 16:15
  • @JohannesBecker the set region ? what do you mean ? – Elikill58 Feb 17 '22 at 16:53
  • In ChunkGenerator.ChunkData (https://hub.spigotmc.org/javadocs/spigot/org/bukkit/generator/ChunkGenerator.ChunkData.html) I saw the Method setRegion() and I thought it would fit to my problem but it didnt. Is there any way to replace every block in a chunk? – Johannes Becker Feb 17 '22 at 17:08