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

Hello Modders!

 

I was wondering if there was a way to override (and not edit base classes) what Vanilla ore's drop?

I've done hours of googleing and nothing came to results, so please dont tell me to google it or something related.

 

If so could you point me in the direction of how to do that?

 

Thanks in Advance!

You make a ore Block like normal (no generation or the like but), can probably just super-class the original ore block to make it quicker, but change the drop method(s) to do what you need, then when assigning ID's just use the ID of the ore you want to replace

  • Author

You make a ore Block like normal (no generation or the like but), can probably just super-class the original ore block to make it quicker, but change the drop method(s) to do what you need, then when assigning ID's just use the ID of the ore you want to replace

 

That's actually bad programming, very bad programming. Not to mention, it also wouldn't work. The vanilla ore would still generate, and mine would gen too. So I thank you for the reply, but I respectively decline. Your free to come back if you find the answer though!

 

Anyone else?

You could try adding an event listener for EntityJoinWorld, check if the entity is instanceof EntityItem and then get the ID, comapre it to that of the ore block, and then spawn items there if its appropriate? I can see a few holes there (could result in item duplication), but that's the only thing I can think of

 

Or, you could use a coremod and override that class - you might want to look at NotEnoughItems and CodeChickenCore - chickenbones overrides a class in NEI, so you could learn from him...

Protip: try and find answers yourself before asking on the forum.

It's pretty likely that there is an answer.

 

Was I helpful? Give me a thank you!

 

 

width=635 height=903http://bit.ly/HZ03zy[/img]

 

 

Tired of waiting for mods to port to bukkit?

use BukkitForge! (now with a working version of WorldEdit!)

That's actually bad programming, very bad programming. Not to mention, it also wouldn't work. The vanilla ore would still generate, and mine would gen too. So I thank you for the reply, but I respectively decline. Your free to come back if you find the answer though!

Debating as to weather or not something is a bad programing or not is beyond the scope of these boards

 

As to weather or not it works? How do you think Eloraam gets spreading mossy cobblestone? Take a look inside Redpower World and you'll see a file called BlockCobbleMossifier.class, it's a new mossy cobblestone block, when ID's are assigned she simply has Forge assign this block the normal mossy cobblestone ID. The reason this works is that when Minecraft does terrain generation it works on ID's, not actual objects

Actually SCC's answer is not that bad... And it does work... although I don't know if you can succeed to assign a block an ID that is already being used... probably Eloraam has a way to go around it, given she's one of the Forge main devs (or was at least), and her skill levels are above those of the average modder.

 

At this moment, the core mod option sounds the best, or you can waste some hours looking at the code, searching for something that allows you to override a block the way Elo does with the Mossy cobble.

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

The why Eloraam assigns the block ID is the same way everybody else assigns block ID's, Forge doesn't throw a hissy fit if you try and use a vanilla ID, only ones already used by mods

Oh, I didn't it ignored vanilla ID's. Nice.

So yeah, overriding the block by ID is pretty easy to do, and should be clean. I'd do it...

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

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.