mirror of
https://github.com/TechnoVisionDev/Forge-Modding-Tutorial-1.16
synced 2024-10-27 20:34:04 +00:00
Natural Mob Spawning
This commit is contained in:
parent
542173bc7d
commit
491192ccdd
@ -0,0 +1,34 @@
|
|||||||
|
package com.technovision.tutorial.world.gen;
|
||||||
|
|
||||||
|
import com.technovision.tutorial.Tutorial;
|
||||||
|
import com.technovision.tutorial.init.ModEntityType;
|
||||||
|
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 = Tutorial.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
|
||||||
|
public class ModEntitySpawns {
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void generateOres(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(ModEntityType.HOG.get(), 10, 3, 5));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user