Hello,
I am in the process of learning how to make a mod but I am stuck on the spawning portion.
My current mapping is: mappings channel: 'snapshot', version: '20200723-1.16.1'
The errors I get are:
error: cannot find symbol
.add(new Biome.SpawnListEntry(ModEntityTypes.BENGAL_CAT.get(), 10, 3, 5));
^
symbol: class SpawnListEntry
location: class Biome
and
error: cannot find symbol
biome.getSpawns(EntityClassification.CREATURE)
^
symbol: method getSpawns(EntityClassification)
location: variable biome of type Biome
Here is the code.
package com.undecimber.naturereconstructed.world.gen;
import com.undecimber.naturereconstructed.naturereconstructed;
import com.undecimber.naturereconstructed.init.ModEntityTypes;
import net.minecraft.entity.EntityClassification;
import net.minecraft.world.biome.Biome;
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 = naturereconstructed.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModEntitySpawns {
@SubscribeEvent
public static void spawnEntities(FMLLoadCompleteEvent event) {
for (Biome biome : ForgeRegistries.BIOMES) {
// Nether Mobs
if (biome.getCategory() == Biome.Category.NETHER) { }
// End Mobs
else if (biome.getCategory() == Biome.Category.THEEND) { }
// Overworld Mobs
else {
if (biome.getCategory() != Biome.Category.OCEAN) {
biome.getSpawns(EntityClassification.CREATURE)
.add(new Biome.SpawnListEntry(ModEntityTypes.BENGAL_CAT.get(), 10, 3, 5));
}
}
}
}
}