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 am in 1.18.1 and trying to get a tree to generate at worldgen.

I have a functioning ConfiguredFeature tree (saplings work properly) at "ModConfiguredFeatures.LEPIDODENDRON". When I add this to generation, on loading a world, the world crashes (the error is incorrect - the loot tables work perfectly without adding trees to worldgen). Is there a resource-loading issue here, with the tree placer trying to register something that does not exist to register yet?

My placer definition in "ModPlacements":
public static final PlacedFeature LEPIDODENDRON_TREE = PlacementUtils.register("lepidodendron_tree_placement", ModConfiguredFeatures.LEPIDODENDRON.placed(RarityFilter.onAverageOnceEvery(12), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_WORLD_SURFACE, BiomeFilter.biome()));

My worldgen:
@SubscribeEvent public static void biomeLoadingEvent(final BiomeLoadingEvent event) {  event.getGeneration().addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, ModPlacements.LEPIDODENDRON_TREE);

Error:
https://pastebin.com/KUZ5gRYC

Repository:https://github.com/AechtRob/Prehistoric_Nature

Edited by Aecht_Rob
Editing URL for repository

the error has nothing to do with the tree feature,
you have an error in a LootTable

 Couldn't parse loot table prehistoricnature:blocks/lepidodendron_leaves

update your repo, since there is no data folder

  • Author

As I mentioned in the original post there is seems to be no error in the loot table and this seems to be a false diagnostic result. I think this because commenting out the worldgen everything runs perfectly, loot tables load fine and behave properly in-game; uncommenting the worldgen makes it error again with this error. (Also if I remove all loot tables entirely the game still falls over).

(It is as if providing the reference to the tree in the worldgen forces it to go looking for things which are not yet registered at that moment in time?)

I have re-synched the repository, to include all assets now (sorry).

Edited by Aecht_Rob

  • Author

Here you go. These are from the IntelliJ dev launcher environment:

(1) This is a log from starting a new world: https://pastebin.com/8j23PUEW

(2) This is from entering a world which was created previously without the mod: https://pastebin.com/31G1ma49

(3) And this is from entering the same world as (2) but with the single line of code in ModWorldEvents:biomeLoadingEvent commented out: https://pastebin.com/qnCLqM5T

It feels like something is not registered properly somehow?

  • Author

After two days of almost literally random trial-and-error I think I have it working. The bug was something to do with passing a ConfiguredFeature where a PlacedfFeature was wanted. I don't fully understand why what I have done works, but it works and that is good for me. My repository is linked above in case there is stuff in there to help anyone else.

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.