How do i make custom liquid more rare

Started by SquidkingInc on

Topic category: Advanced modding

Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i make custom liquid more rare

i made a custom liquid at set it to generate in the overworld but it spawns so frequently that world generation takes ages, how do i make it more rare

This is not possible yet,…
Mon, 05/13/2019 - 15:39

This is not possible yet, but we have a ticket for this open on our issue tracker. Upvote it to get it resolved faster.

Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can i do it with custom code…
Mon, 05/13/2019 - 18:16

Can i do it with custom code though?

 

You could wrap generator…
Mon, 05/13/2019 - 18:57

You could wrap generator code with a condition such as if(Math.random() > 0.5) to reduce the generating frequency.

Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can't find generator code  
Tue, 05/14/2019 - 18:41

Can't find generator code

 

Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i wrap it do i just…
Tue, 05/14/2019 - 22:01

How do i wrap it

do i just paste the code in there?

Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
where do i paste it :p  
Tue, 05/14/2019 - 22:02

where do i paste it :p

 

Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Override     public void…
Tue, 05/14/2019 - 22:05

@Override
    public void generateSurface(World world, Random random, int chunkX, int chunkZ) {
        int i = chunkX + random.nextInt(16) + 8;
        int j = random.nextInt(256);
        int k = chunkZ + random.nextInt(16) + 8;
        new WorldGenLakes(block).generate(world, random, new BlockPos(i, j, k));
    }
}

If you don't know where to…
Wed, 05/15/2019 - 11:28

If you don't know where to paste this, you might want to learn some Java before trying this. But you should wrap the generated code with your if statement:

if(random.nextInt(100) > 50) {
    int i = chunkX + random.nextInt(16) + 8;
    int j = random.nextInt(256);
    int k = chunkZ + random.nextInt(16) + 8;
    new WorldGenLakes(block).generate(world, random, new BlockPos(i, j, k));
}

In my example, I use provided random generator so the probability is conditioned with the world seed.