crackedEgg Posted March 11, 2019 Posted March 11, 2019 I'm trying to spawn mobs in specific biomes. I noticed addSpawn method is protected in Biome class and there doesn't seem to be a forge registry for this. Is there another way to do this in 1.13.x or am I missing something? Quote
LTNightshade Posted March 12, 2019 Posted March 12, 2019 I would try something like : Biome biome = RegistryManager.ACTIVE.getRegistry(Biome.class).getValue(new ResourceLocation("minecraft", "badlands")); biome.getSpawns(EnumCreatureType.MONSTER).clear(); biome.getSpawns(EnumCreatureType.MONSTER).add(new Biome.SpawnListEntry(EntityType.BAT,1,1,2)); Quote
crackedEgg Posted March 12, 2019 Author Posted March 12, 2019 Using both your suggestions I got spawning working. It looks like I needed an EntitySpawnPlacement as well. I didn't see any spawns until I added the placement. Thanks for all your help! private void registerEntitySpawn(EntityType<? extends EntityLiving> type, Biome[] biomes, int spawnProb, int minSpawn, int maxSpawn) { EntitySpawnPlacementRegistry.register(type, EntitySpawnPlacementRegistry.SpawnPlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, null); for (Biome bgb : biomes) { Biome biome = ForgeRegistries.BIOMES.getValue(bgb.getRegistryName()); if (biome != null) { biome.getSpawns(EnumCreatureType.MONSTER).clear(); biome.getSpawns(EnumCreatureType.MONSTER).add(new Biome.SpawnListEntry(type, spawnProb, minSpawn, maxSpawn)); } } } Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.