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

I created and registered several placed features through code (not json based)

Now I need to add them to vanilla biomes, for this I created biome tags for the biomes the features are supposed to generate in.

 

the biome tag is created at:

/data/example_mod/tags/worldgen/biome/has_feature/large_mushroom.json

the biome tag is referenced in my code like this:

public static final TagKey<Biome> HAS_FEATURE_LARGE_MUSHROOM = getTagKey("has_feature/large_mushroom");
/* more tags created similar */

private static TagKey<Biome> getTagKey(String id) {
     return TagKey.create(Registry.BIOME_REGISTRY, new ResourceLocation("example_mod", id));
}

my BiomeLoadingEvent (registered to the forge eventbus)

public static void onBiomeLoad(final BiomeLoadingEvent event) {
    Biome biome = ForgeRegistries.BIOMES.getValue(event.getName());
    boolean isCorrectBiome = ForgeRegistries.BIOMES.tags().getTag(HAS_FEATURE_LARGE_MUSHROOM).contains(biome); //always false
}

 

It looks like the biome tags are not filled/validated when the BiomeLoadingEvent is fired?

but using the command `/locatebiome #example_mod:has_feature/large_mushroom` works without problems

 

Am I missing something, or is there another way of adding my features to biomes without hardcoding them?

 

The main issue is that `BiomeLoadingEvent` intercepts the biome before it is loaded, so it wouldn't be in the registry. Additionally, I believe that the event is loaded before tags are populated, so you wouldn't be able to write anything anyways. In my opinion, I would just update to 1.19 with biome modifiers and use those since they have no issues supporting tags.

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.