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, I am stuck on having an ore that is generated in the world drop and item, and another item.

 

Ive looked at the crops block to see how wheat did that with seeds and wheat, but I cannot figure it out.

 

    protected int getGemItem()
    {
        return KarbideCore.tungstenite.itemID;
    }

    protected int getOreItem()
    {
        return KarbideCore.karbide.itemID;
    }

    public int idDropped(int par1, Random par2Random, int par3)
    {
        return par1 == 7 ? this.getOreItem() : this.getGemItem();
    }

public int quantityDropped(int meta, int fortune, Random random){
	return 1 + random.nextInt(2);
}

the code you provided looks ok - it should drop either ore when block's meta is 7 or gem otherwise. you want dropping two different items from your block? if so you'll probably have to override Block.getBlockDropped method and fill the return list with your items (ItemStack(s) containing your item(s)).

mnn.getNativeLang() != English

If I helped you please click on the "thank you" button.

  • Author

Hmm, so thats what the par1 == 7 is about, the metadata! oh, so at its last instance before it breaks it decieds if it drops a ore or a gem?

 

And love the Star Trek Skin.

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.