Jump to content

[Forge 1.12.2] Issues applying .getItemDropped


boredherobrine13

Recommended Posts

Hi, I am recoding my mod for 1.12.2 and in the past I have made a new "BlockX" glass for each new ore so that I can define what item the ore will drop when mined using a method like the following.

Spoiler

	public Item getItemDropped(IBlockState state, Random rand, int fortune){
		return ModItems.coke;
}

 

However as I continue to expand my mod this is clearly inefficient because I will have a ton of redundant class files. So I'd like to define this when declaring the blocks in my ModBlocks class. However everything I've tried so far has had issues. Ex:

Spoiler

public static BlockOre oreBituminousCoal = new BlockOre("ore_bituminous_coal").setCreativeTab(MoreFuelsMod.creativeTab).getItemDropped(state, rand, fortune);

 

In the case of .getItemDropped(state, rand, fortune) I'm not sure what to input for the state, rand, and fortune. I recognize I need to change my method to something more generic and have it return something else but I'm not sure exactly how to restructure it and if i should mess with the "IBlockState state, Random rand, int fortune)" in the original method from above or if I even can remove things. Is this even possible? Am I overlooking something simple?

Link to comment
Share on other sites

Well, getItemDropped returns the item dropped. It is not a method that you use to tell the Block class what item to drop.

 

You're going to have to set up a setItemDropped method yourself.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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