I have made a biome and would like to make it rarer i have gone through minecraft code and looked up how to do it on the internet but found nothing. if someone could give me a heads up on where to start or how to do it that would be much appreciated. I'm using minecraft 1.7.10. If you need me to post any source code just ask.
I would have thought that it was the integer in the biome manager line because it is related to weight and if that is correct would you be able to explain to me how it works
Yes, that number controls it. The lower the number the less likely it will be to be chosen. The number is used as the "weight" for a WeightedRandom.Item algorithm.
The way it works though is relative to all the other weights. Basically, the random function adds all the weights together and then the chance for your biome is the biome's weight over the total weight.
For example, if you only had one biome, then no matter what weight you set it would have 100% chance because it's weight would be same as total weight. If you had two biomes with same weight, they would have 50% chance no matter whether they were both 1 or both 10.
Since there are already a number of other biomes with weights, the total weight is already pretty big. So you cannot make your biome 100%. But the weight is also an int type so the smallest weight you can give is 1.
I have made a biome and would like to make it rarer i have gone through minecraft code and looked up how to do it on the internet but found nothing. if someone could give me a heads up on where to start or how to do it that would be much appreciated. I'm using minecraft 1.7.10. If you need me to post any source code just ask.
You should be able to set the rarity when you register it. What is your registration code?
package bawlind.pack.biome;package bawlind.pack.biome;
import net.minecraft.world.biome.BiomeGenBase;import net.minecraftforge.common.BiomeDictionary;import net.minecraftforge.common.BiomeDictionary.Type;import net.minecraftforge.common.BiomeManager;import
net.minecraftforge.common.BiomeManager.BiomeEntry;
public class RegisterBiome { public static void mainRegistry() { registerBiome(); }
public static BiomeGenBase biomeBawlind; public static void registerBiome() {
biomeBawlind = new BiomeGenBawlind(77).setBiomeName("Bawlind");
BiomeDictionary.registerBiomeType(biomeBawlind, Type.OCEAN);
BiomeManager.warmBiomes.add(new BiomeEntry(biomeBawlind, 10)); BiomeManager.addSpawnBiome(biomeBawlind); }}
I would have thought that it was the integer in the biome manager line because it is related to weight and if that is correct would you be able to explain to me how it works
Yes, that number controls it. The lower the number the less likely it will be to be chosen. The number is used as the "weight" for a WeightedRandom.Item algorithm.
The way it works though is relative to all the other weights. Basically, the random function adds all the weights together and then the chance for your biome is the biome's weight over the total weight.
For example, if you only had one biome, then no matter what weight you set it would have 100% chance because it's weight would be same as total weight. If you had two biomes with same weight, they would have 50% chance no matter whether they were both 1 or both 10.
Since there are already a number of other biomes with weights, the total weight is already pretty big. So you cannot make your biome 100%. But the weight is also an int type so the smallest weight you can give is 1.
Anyway, 1 would be the rarest you can make it.
Cheers!