Posted December 12, 20204 yr I am trying to make my own mod and I want to add ores at overworld. A tutorial said I should use biome.addFeature like this: @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) public class OreGen { @SubscribeEvent public static void onSetUpEvent(FMLCommonSetupEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { biome.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES, Feature.ORE.withConfiguration( new OreFeatureConfig(OreFeatureConfig.FillerBlockType.BASE_STONE_OVERWORLD, BlockRegistry.block_mcbbswiki.get().getDefaultState(), 3) ).withPlacement(Placement.DEPTH_AVERAGE.configure(new DepthAverageConfig(20, 5))) ); } } } However, in minecraft 1.16.4, there's no biome.addFeature method. So, How do I use OreGen?
December 12, 20204 yr First you need to register your feature to the ConfiguredFeature Registry Then you can add it to the biome generation through the Biome Loading Event (not the Common Setup) if you want an example: @Mod.EventBusSubscriber(modid = TutorialMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ModFeatures { public static ConfiguredFeature<?, ?> ORE_SILVER_CONFIG; @SubscribeEvent public static void setup(FMLCommonSetupEvent event) { ORE_SILVER_CONFIG = Registry.register(WorldGenRegistries.CONFIGURED_FEATURE, "ore_silver", Feature.ORE.withConfiguration( new OreFeatureConfig( OreFeatureConfig.FillerBlockType.BASE_STONE_OVERWORLD, ModBlocks.SILVER_ORE.get().getDefaultState(), 9) ).range(64).square().func_242731_b(20) ); } } @SubscribeEvent public void onBiomeLoading(final BiomeLoadingEvent biome) { if(biome.getCategory() == Biome.Category.NETHER || biome.getCategory() == Biome.Category.THEEND) return; biome.getGeneration().getFeatures(GenerationStage.Decoration.UNDERGROUND_ORES) .add(() -> ModFeatures.ORE_SILVER_CONFIG); } Edited December 12, 20204 yr by kiou.23
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.