Jump to content

Recommended Posts

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);
}

Posted

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.

Posted

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

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