Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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.

  • 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?

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.

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

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.