Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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.

  • 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 by QuantumSoul

  • 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;

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.