Jump to content

Changing Emerald Spawn


Armeleon
 Share

Recommended Posts

I am writing a mod that needs to change what Emeralds drop. The easiest way I have found to do this is to remove the spawn, then write my own block which drops what I need it to drop.  I have managed to extend the Extreme Hills biome class and add in the new Emerald for spawn, but it stills spawns the old Emerald in too. I don't want to have to edit the minecraft jar, but I can't think of anything else to try.  Is there a forge hook I'm missing to cancel emerald spawn? Or maybe reduce its spawn frequency to 0?  Any help would be more than welcome!

Link to comment
Share on other sites

Subscribe to OreGenEvent.GenerateMinable.

Keep in mind that it's posted on the MinecraftForge.ORE_GEN_BUS instead of the default EventBus.

 

I subscribed to this one in order to deny diamond gen, but I didn't see any hook for emeralds.  Is there one in a newer release? Or is there an EventBus that denies biomes so I can override the Extreme Hills entirely?

Link to comment
Share on other sites

Turns out I didn't look close enough. Emeralds are generated completely different from any other ore so they are not grabbed by the normal Forge OreGen hook.

If you really only want to change what emeralds drop you are better off replacing the emerald block instance in the blocks list:

Block.blocksList[block.emerald.blockID] = null;
Block.blocksList[block.emerald.blockID] = new BlockFakeEmerald(Block.emerald.blockID);

It's dirty, but it works. If you want to make it cleaner, make a coremod or wait for a BlockBreakEvent in forge.

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

 Share



×
×
  • Create New...

Important Information

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