# How to make a world gen rarer? [1.7]

## Recommended Posts

So I have a structure that I am generating, but it is too common. Changing the "chunkX * 16, chunkZ * 16" to "chunkX * 128, chunkZ * 128" makes it rarer but also generates super super slowly.

```      @Override
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
{
switch (world.provider.dimensionId)
{
case -1:
generateNether(world, random, chunkX * 16, chunkZ * 16);
case 0:
generateSurface(world, random, chunkX * 16, chunkZ * 16);
case 1:
generateEnd(world, random, chunkX * 16, chunkZ * 16);
}
}

private void generateEnd(World world, Random random, int x, int z)
{

}

private void generateSurface(World world, Random random, int x, int z)
{

}

private void generateNether(World world, Random random, int x, int z)
{
//Nethengeic Pit Coords//
int Xcoord = x + random.nextInt(16);
int Ycoord = 25 + random.nextInt(35);
int Zcoord = z + random.nextInt(16);

(new NetherTower()).generate(world, random, Xcoord, Ycoord, Zcoord);
```

##### Share on other sites

So I got it generating but it is far too common.

##### Share on other sites

---------------------

Edited by chimera27

Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

##### Share on other sites

Just use the random function to reduce the chance, IE:

```if(Random.nextInt(5) == 1){
//Generation code
}
```

This will effectively make it 1/5 as common. (Just change the 5 into whatever you want the denominator of the chance fraction to be)

This is actually what I ended up doing yesterday. Thanks for the tip.

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

• ### Posts

• https://drive.google.com/file/d/1TEC9iPjvpYt6tZCYSNkxGgOeYem3hRao/view?usp=sharing i gettin this message and crash...
• The crash log file was too large to fit into one pastebin so I had to cut it into 2 parts: Crash Log 1, Crash Log 2 I tried creating a new world in the same modpack and it crashed with the exit code -1: https://pastebin.com/EjvB4WGD before even making it to the creation screen. I had the same world creation crash initially when I was making the pack and I solved it by removing some mods. I was thinking maybe some mod got accidentally deleted but I forgot to update the modlist when finalizing what mods I had in so I'm not sure which ones may have been removed.
• figured it out thank you!
• its still saying the error  https://drive.google.com/file/d/1SKWEhgoKBISB4Uo3lqBZEUAymEsBy0-b/view?usp=sharing   is my modpack is it possibly conflicting with another mod?? because i replaced it with the link you sent and it still gave the error
• Replace it with this build: https://www.curseforge.com/minecraft/mc-mods/better-dogs-x-doggy-talents-next/files/4971380

• ### Who's Online (See full list)

×

• #### Activity

×
• Create New...