Jump to content

1.16.4 Ore generation


Recommended Posts

You need to register a configured feature. to do so, you can create a field MY_ORE_CONFIG, of type ConfiguredFeature<?, ?>.

Then in the common setup, you want to call Registry.register(), passing in the type of world gen registry (for ores, that's WorldGenRegistries.CONFIGURED_FEATURES), than a string that will be the registry key, and then the actual configured feature. you may want to take a look at the Features class, and see how it creates configured features for ores.

For any standard ore you'll use Feature.ORE.withConfiguration(), and pass the feature configurations, which would be a new instance of a OreFeatureConfig.

Again, looking at the Features class, and how that class register Configured Features should really simplify thing.


After you have the Configured Feature Registered, you need to add it to the biomes generation algorithm.

You can do this in the BiomeLoadingEvent. simply check the biome category for the biomes that you want (for instance, if you're adding the ore to the overworld, than don't add it to the Nether and End biomes). you can call BiomeLoadingEvent#getGeneration(), to get the biome's generation algorithm, from there you can call BiomeGenerationSettingsBuilder#getFeatures() to get all the features, and you'd need to pass the Generation Stage, for commom ores: GenerationStage.Decoration.Underground. and from there you can call .add() to add your configured feature (note: .add() will expect a Supplier of a ConfiguredFeature)

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.