The spawn weight is kinda of tricky because it is different per biome. You need to look anywhere a SpawnListEntry is created with parameters for weight, min group size and max group size.
For example, the Biome class defaults to the following:
The spawn weight is kinda of tricky because it is different per biome. You need to look anywhere a SpawnListEntry is created with parameters for weight, min group size and max group size.
For example, the Biome class defaults to the following:
List<Biome> biomes = new ArrayList<>();
for (BiomeDictionary.Type biomeType : biomeTypes) {
biomes.addAll(BiomeDictionary.getBiomes(biomeType));
}
but it looks redundant. Furthermore it is additionally required to skip all nether biomes(cause some mods, such as Biomes o Plenty add new nether biomes of different types, which will be in this list)
Actually, the code I gave earlier for all biomes is somewhat outdated because now there is the event-based biome registration so you can use ForgeRegistries.BIOMES.getValues() to get all the biomes.
I believe all these methods would give all the biomes available in the game across all world types. To determine if a biome is for the nether or end, you can use the BiomeDictionary and use the getTypes() method to check if the biome is of Type.NETHER or Type.END.
Hello. I'm wondering which spawn weight have vanilla mobs. May be someone know where can I find it.
Also I'm looking for a handy way to get list of all overworld biomes.
To get a list of all biomes I think you can do:
BiomeGenBase[] allBiomes = Iterators.toArray(Iterators.filter(Iterators.forArray(BiomeGenBase.getBiomeGenArray()), Predicates.notNull()), BiomeGenBase.class);
The spawn weight is kinda of tricky because it is different per biome. You need to look anywhere a SpawnListEntry is created with parameters for weight, min group size and max group size.
For example, the Biome class defaults to the following:
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntitySheep.class, 12, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityCow.class, 8, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySpider.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombie.class, 95, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombieVillager.class, 5, 1, 1));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySkeleton.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityCreeper.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntitySlime.class, 100, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityEnderman.class, 10, 1, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityWitch.class, 5, 1, 1));
this.spawnableWaterCreatureList.add(new Biome.SpawnListEntry(EntitySquid.class, 10, 4, 4));
this.spawnableCaveCreatureList.add(new Biome.SpawnListEntry(EntityBat.class, 10, 8, 8));
However, most biomes seem to clear that list and then rebuild it with different list. For example, BiomeDesert does the following:
this.spawnableCreatureList.clear();
this.spawnableCreatureList.add(new Biome.SpawnListEntry(EntityRabbit.class, 4, 2, 3));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombie.class, 19, 4, 4));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityZombieVillager.class, 1, 1, 1));
this.spawnableMonsterList.add(new Biome.SpawnListEntry(EntityHusk.class, 80, 4, 4));
So basically you would need to go through each biome and list it all out.
Thanks a lot. This is exactly what I am looking for.
So this should provide all overworld biomes or all biomes(even nether and end biomes)?
At the moment I do in in next way:
private static final List<BiomeDictionary.Type> OVERWORLD_BIOMES = new ArrayList<>(Arrays.asList(
BiomeDictionary.Type.MESA,
BiomeDictionary.Type.FOREST,
BiomeDictionary.Type.JUNGLE,
BiomeDictionary.Type.PLAINS,
BiomeDictionary.Type.MOUNTAIN,
BiomeDictionary.Type.HILLS,
BiomeDictionary.Type.SWAMP,
BiomeDictionary.Type.SANDY,
BiomeDictionary.Type.SNOWY,
BiomeDictionary.Type.WASTELAND,
BiomeDictionary.Type.BEACH,
BiomeDictionary.Type.WATER
));
List<Biome> biomes = new ArrayList<>();
for (BiomeDictionary.Type biomeType : biomeTypes) {
biomes.addAll(BiomeDictionary.getBiomes(biomeType));
}
but it looks redundant. Furthermore it is additionally required to skip all nether biomes(cause some mods, such as Biomes o Plenty add new nether biomes of different types, which will be in this list)
Actually, the code I gave earlier for all biomes is somewhat outdated because now there is the event-based biome registration so you can use ForgeRegistries.BIOMES.getValues() to get all the biomes.
I believe all these methods would give all the biomes available in the game across all world types. To determine if a biome is for the nether or end, you can use the BiomeDictionary and use the getTypes() method to check if the biome is of Type.NETHER or Type.END.