Search In
• More options...
Find results that contain...
Find results in...

# 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.

×   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

• I'm pretty sure the particle can be defined in the blockmodel.json.
• So I wanna make a mod for forge that can addd a new slot for the elytra and one for music discs to play in my inventory. I wanna make an mp3 like a music disc bundle and put discs inside it and select between discs with two customizable controls. But the only problem is that I know NOTHING about coding forge mods. Can someone help me make all of those without having to use an api or datapack? (I am modding forge not fabric by the way)
• I create a block which has a complex texture. Howerver when I trying to destroy it, the particles that appear seems terrible beacuse of the texture. Can I get a better particles when I'm breaking the blocks?
• for some reason no matter what i try i cannot seem to get minecraft forge to install using java i installed java yet it still dosent work

• 1
• 0
• 4
• 0
• 0
• ### Who's Online (See full list)

×

• #### Activity

×
• Create New...