Jump to content

How to modify vanilla ore generation in 1.12.2?


Jiro7

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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