Topic category: Help with Minecraft modding (Java Edition)
Hello everyone. I have problems with the spawning rates of my plants/flowers. I hope anyone had the same problem and found a solution.
I made a mod that has some flowers and other plants in it. The plants itself work fine, but i want some of them to not spawn in groups of 5-7 every 20 blocks.
So i changed to code. In this code down here are the original settings:
public void generateSurface(World world, java.util.Random randomGenerator, int chunkX, int chunkZ) {
for (int i = 0; i < 1; i++) {
int l6 = chunkX + randomGenerator.nextInt(16 + 8);
int i11 = randomGenerator.nextInt(128);
int l14 = chunkZ + randomGenerator.nextInt(16 + 8);
(new WorldGenFlowers(((BlockFlower) mcreator_starBloom.block), BlockFlower.EnumFlowerType.DANDELION)).generate(world, randomGenerator,
new BlockPos(l6, i11, l14));
}
}
I changed the numbers 16; 8 to 32; 16 but nothing happened.
After some experimenting, i used the numbers 480; 240 and the plants are insignificantly rarer (spawn every 30 or 40 blocks). Instead it takes around !10 minutes! to spawn them in a new world, even if the world is already loaded and you can play on it.
Is there another way to make them rarer? And what does the .nextInt(128) mean?
If you don't know code don't try to edit it. A chunk is a 16x16 area by the way