Posted May 19, 20205 yr Hi, My mobs spawn in the sky and die. Here is how I register them in the FMLCommonStetupEvent BiomeInit.BIOMES.getEntries().stream().map(RegistryObject::get).filter(biome -> biome != BiomeInit.VOID_BIOME.get()).forEach(b -> { List<Biome.SpawnListEntry> creatures = b.getSpawns(EntityClassification.CREATURE); creatures.add(new Biome.SpawnListEntry(EntityInit.ONE.get(), 50, 1, 3)); creatures.add(new Biome.SpawnListEntry(EntityInit.ZERO.get(), 50, 1, 3)); List<Biome.SpawnListEntry> monsters = b.getSpawns(EntityClassification.MONSTER); monsters.add(new Biome.SpawnListEntry(EntityInit.BUG.get(), 15, 3, 4)); monsters.add(new Biome.SpawnListEntry(EntityInit.VIRUS.get(), 15, 1, 2)); }); I tried overriding the CreatureEntity#getPathWeight but I feel like it's not the right thing to do and it didn't work.
May 19, 20205 yr I'm guessing you forgot all about EntitySpawnPlacementRegistry from your previous post.
May 19, 20205 yr Author 6 minutes ago, ChampionAsh5357 said: I'm guessing you forgot all about EntitySpawnPlacementRegistry from your previous post. Well how do I do it because there is no ForgeRegistry for it ? EDIT: I did try with canSpawn, didn't work. Edited May 19, 20205 yr by QuantumSoul
May 20, 20205 yr Why do you need a registry for it? You just literally call the register method when setting up the common lifecycle. Edited May 20, 20205 yr by ChampionAsh5357
May 20, 20205 yr Author 10 hours ago, ChampionAsh5357 said: Why do you need a registry for it? You just literally call the register method when setting up the common lifecycle. Well, I'd like to prevent my mobs from spawning in air. My question is how do I do so ? I saw that vanilla mobs use EntitySpawnPlacementRegistry so that's why I asked; I just want to know what is the best method do it; 3 hours ago, diesieben07 said: You need to use DeferredWorkQueue to do this I already do; The function above is called using DefferedWorkQueue#runLater;
May 20, 20205 yr Author 4 minutes ago, diesieben07 said: You just need to call EntitySpawnPlacementRegistry.register. Do I need the deferredWorkQueue ?
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.