Jump to content

Recommended Posts

Posted
package com.fmom.cb.world.gen;

import com.fmom.cb.Main;
import com.fmom.cb.init.ModEntityTypes;

import net.minecraft.entity.EntityClassification;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.MobSpawnInfo;
import net.minecraft.world.biome.MobSpawnInfo.Spawners;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.registries.ForgeRegistries;

@Mod.EventBusSubscriber(modid = Main.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModEntitySpawns {
	
	@SubscribeEvent
	public static void spawnEntities(BiomeLoadingEvent event) {
		
		for(Biome biome : ForgeRegistries.BIOMES) {
			if(biome.getCategory() == Biome.Category.NETHER) {}
			
			else if(biome.getCategory() == Biome.Category.THEEND) {}
			
            else {
                if (biome.getCategory() != Biome.Category.OCEAN) {
                    biome.getMobSpawnInfo().getSpawners(EntityClassification.CREATURE)
                            .add(new Biome.SpawnListEntry(ModEntityTypes.CAPYBARA.get(), 10, 3, 5));
                }
            }
		}
		
	}
	
}

Hello, I'm making an entity spawn system following technovision's tutorial and I can't seem to find Biome.SpawnListEntry

Posted

It looks like spawn list entry is no longer on  mappings channel: 'snapshot', version: '20210309-1.16.5' so i wrote this down instead:

package com.fmom.cb.world.gen;

import com.fmom.cb.Main;
import com.fmom.cb.init.ModEntityTypes;

import net.minecraft.entity.EntityClassification;
import net.minecraft.world.biome.MobSpawnInfo;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = Main.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE)
public class ModEntitySpawns {

	@SubscribeEvent
	public static void onBiomeLoading(BiomeLoadingEvent e) {
			e.getSpawns().withSpawner(EntityClassification.CREATURE, new MobSpawnInfo.Spawners(ModEntityTypes.CAPYBARA.get(), 100, 5, 5));
	}
}

 

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.