Posted October 22, 20186 yr I've been searching everywhere on how to change the vanilla ore generation but all I found is how to completely disable it. But I don't want to change some ores like dirt, andesite and such. I want to change the generation of ores like iron, gold, diamonds or quartz to make them rarer and spawn in smaller veins. How can I do this? Additional question: is it possible to make one ore generate inside another ore? For example, if I add a rare variation of iron ore, can I make it spawn with Iron Ore as the base block to generate in? Thanks for the help.
October 22, 20186 yr 4 hours ago, Jiro7 said: I want to change the generation of ores like iron, gold, diamonds or quartz to make them rarer and spawn in smaller veins. How can I do this? Disable their generation and run your generation instead. To disable the generation of a specific ore handle the GenerateMinable event, check if the EventType is the one you want to disable and set the result to DENY. 4 hours ago, Jiro7 said: Additional question: is it possible to make one ore generate inside another ore? For example, if I add a rare variation of iron ore, can I make it spawn with Iron Ore as the base block to generate in? It is absolutely possible but depends on the generation method. You could stop the vanilla's iron ore generation and replace it with your own one that generates the ore and maybe generates the rare ore. If for some reason you can't do that(for example you need to generate your ore in the ore of an another mod that doesn't throw any events) you will have to scan the chunk for the ores to generate your stuff in.
October 22, 20186 yr Author 5 minutes ago, V0idWa1k3r said: Disable their generation and run your generation instead. To disable the generation of a specific ore handle the GenerateMinable event, check if the EventType is the one you want to disable and set the result to DENY. It is absolutely possible but depends on the generation method. You could stop the vanilla's iron ore generation and replace it with your own one that generates the ore and maybe generates the rare ore. If for some reason you can't do that(for example you need to generate your ore in the ore of an another mod that doesn't throw any events) you will have to scan the chunk for the ores to generate your stuff in. Thank you for the answer. Do I need to create a new class to handle the GenerateMinable event (with EventBusSubscriber) or can I do it on my mod world generation class?
October 22, 20186 yr 4 minutes ago, Jiro7 said: Do I need to create a new class to handle the GenerateMinable event (with EventBusSubscriber) or can I do it on my mod world generation class? https://mcforge.readthedocs.io/en/latest/events/intro/ Any class/object can be an event handler. There are no restrictions as far as I am aware.
October 22, 20186 yr 2 minutes ago, Jiro7 said: (with EventBusSubscriber) You cannot use that for this event you will have too add it manually to MinecraftForge.ORE_GEN_BUS(or something like that) VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
October 23, 20186 yr Author Thank you all for the replies, it finally worked! In case anyone else has this same problem and finds this topic, this is what I did: I created this class: public class OreDisabler { @SubscribeEvent public static void vanillaGenerationAttempt(GenerateMinable event){ if(event.getType().equals(EventType.IRON)){ event.setResult(Result.DENY); } } } And change IRON with whatever ore you want to disable. Also make sure to import the right EventType, the one from GenerateMinable. Then added this: MinecraftForge.ORE_GEN_BUS.register(OreDisabler.class); inside this method of my main mod class: @EventHandler public void init(FMLInitializationEvent event) { ModRecipes.init(); MinecraftForge.ORE_GEN_BUS.register(OreDisabler.class); } Hopefully I can save someone from having the same confusion as I had!
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.