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

Quick question and maybe someone can provide an example. Is there a way to add a spawn to ALL biomes? I am aware of the addSpawnable function but I am sure there is an easier way then physically adding in every Biome to an array. Also what if you have a mod that adds biomes like Biomes O Plenty and the like? How would you have your spawnables get added into that list also?

Not sure if you can still get registered biomes from the BiomeDictionary, but older versions had a getBiomesForType(Type.Forest) that could be useful (I seriously doubt you really want it to be in absolutely every biome. e.g. ocean and nether).

 

Another way I found is to wait for the RegistryEvent.Register<Biome> event and then just do something like this:

        final IForgeRegistry<Biome> registry = event.getRegistry();
        for(Biome b :registry) {
            System.out.println(b.getBiomeName());
        }

But I am sure that there is a better way to get access to the ForgeRegistry.  My example above is an absolute nightmare for way too many reasons. Could one of the code gods please descend and help us?

Edited by Jacky2611

Here could be your advertisement!

All of the registries for vanilla types are stored in the ForgeRegistries class.

 

As @Jacky2611 said, use the BiomeDictionary (specifically BiomeDictionary#getBiomes) to get the Biomes with the specified Type.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

@Choonster Damn, I knew it. The ForgeRegistries class was the first place I looked. Could it be that I need a forge version newer than 14.21.1.2387(recommended) if I want to get the registries from inside the ForgeRegistries class?

Here could be your advertisement!

4 minutes ago, Jacky2611 said:

@Choonster Damn, I knew it. The ForgeRegistries class was the first place I looked. Could it be that I need a forge version newer than 14.21.1.2387(recommended) if I want to get the registries from inside the ForgeRegistries class?

 

No, the ForgeRegistries class was first added in 1.9 and the Biome registry has been in it since then.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

So lets, see. In looking at the biome dictionary. Types, HOT, COLD, MUSHROOM, BEACH, FOREST, MOUNTAIN, PLAINS, WET, MESA pretty musch seems to catch all biomes. Anyone know if I am missing any off the top of their head? Yes this one mob is supposed to spawn everywhere lol. Including in the mushroom biomes.

 

Secondly EntityRegister.addSpawn looks for the actual Biome though. How can I make it so that i put in the BiomeDictionary.getBiomes(BiomeDictionary.Type.HOT) and it will be acceptable for the .addSpawn

I'm sure it is rather simple, but  I've enver worked with spawns in the updated forge versions.

 

EntityRegistry.addSpawn(EntityCreeperPrime.class, 14, 1, 6, EnumCreatureType.MONSTER, BiomeDictionary.getBiomes(BiomeDictionary.Type.MUSHROOM));

Still looks for the actual Biome even though if I am reading correctly, that should return all biomes of type Mushroom. (Mushroom Shore, Mushroom)

Edited by HalestormXV

If you want the mob to spawn in every single biome rather than biomes of a certain type, use IForgeRegistry#getValues to get a List of every registered Biome. You then need to convert this to an array and pass it as the vararg parameter of EntityRegistry.addSpawn.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author
43 minutes ago, Choonster said:

If you want the mob to spawn in every single biome rather than biomes of a certain type, use IForgeRegistry#getValues to get a List of every registered Biome. You then need to convert this to an array and pass it as the vararg parameter of EntityRegistry.addSpawn.

Okydokey. Thanks

 

Unlreated note but if either of you can take a look at another thread I made that is giving me issues. I'd apprecaite it. I don't want to keep bumping the thread over and over but perhaps a simplistic answer can be made: 

Spoiler

 

 

Edited by HalestormXV

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.