Jump to content

[1.18.1] How to add tree Features ?


Recommended Posts

Normally in 1.17.1 i use BiomeLoadingEvent#getGeneration()#getFeatures() then and add some Supplier ConfiguredFeature<?, ?>

But in 1.18.1 it want PlacedFeature and i look ConfiguredFeature class i see placed() method.

Ummmmm Let's go back to 1.17.1 on decorated() method by put this parameter

.decorated(Features.Decorators.HEIGHTMAP_SQUARE).decorated(FeatureDecorator.COUNT_EXTRA.configured(new FrequencyWithExtraChanceDecoratorConfiguration(1, 0.1F, 1)))

Okay now coming to 1.18.1 i use placed() method by put this parameter.

.placed(PlacementUtils.HEIGHTMAP_WORLD_SURFACE, PlacementUtils.countExtra(1, 0.1F, 1))

but there are no trees, 
Is there a way to make a tree spawn?

Link to comment
Share on other sites

the Features class from 1.17 has been split into separate classes,
the Tree Features are now in net.minecraft.data.worldgen.features.TreeFeatures

in 1.18 you need also a PlacedFeature for each ConfiguredFeature,
you can find the vanilla Tree examples in net.minecraft.data.worldgen.placement.TreePlacements


  • Like 1
Link to comment
Share on other sites

@Luis_ST I check ConfiguredFeature class from vanilla i see method placed() has new PlacedFeature() object if i use @Override from placed() method and return some PlacedFeature from TreePlacements can it working ?

Edit : Maybe give me an example ?

Edited by zlappedx3
Link to comment
Share on other sites

why did you not create the Features (ConfiguredFeature and PlacedFeature), in the same way how vanilla does it?
you don't need to extends/overwrite something

also the classes i told you above has a lot of examples

Edited by Luis_ST
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now

  • Create New...

Important Information

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