Skip to content

Instantly share code, notes, and snippets.

@IMB11
Created November 5, 2022 22:11
Show Gist options
  • Save IMB11/1d91e790565e7714613159d13c1dac31 to your computer and use it in GitHub Desktop.
Save IMB11/1d91e790565e7714613159d13c1dac31 to your computer and use it in GitHub Desktop.
BiomeModifications.create(Woof.id("wolf_additions")).add(ModificationPhase.REPLACEMENTS, biomeSelectionContext -> true, (biomeSelectionContext, biomeModificationContext) -> {
// Iterate all wolf variant types.
for (Map.Entry<RegistryKey<Variant>, Variant> variantRegistryKey : WoofAPI.VARIANT_REGISTRY.getEntrySet()) {
// Check if variant can spawn in biome.
if (!variantRegistryKey.getValue().biomePredicate().apply(biomeSelectionContext.getBiomeRegistryEntry()))
continue;
biomeModificationContext.getSpawnSettings().removeSpawnsOfEntityType(EntityType.WOLF);
biomeModificationContext.getSpawnSettings().addSpawn(SpawnGroup.MISC, new SpawnSettings.SpawnEntry(EntityType.WOLF, 5, 1, 2));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment