Jump to content

Recommended Posts

Posted

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.

Posted (edited)
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 by QuantumSoul
Posted
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;

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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