Jump to content

[1.7.2] Making an ore why do i get an error?


jellefly12

Recommended Posts

Hello , i want to make an ore dropping one of my items

this is the code for the Ore dropping an Item

 

public static int idDropped(int par1 , random par2Random , int par3){

      return mod.ItemRuby.itemID;

}

public int QuantityDropped(Random random){

return 1;

}

 

 

 

Why do i get an error at mod.ItemRuby.itemID i know you cant use itemids anymore but i juts cant find how i can fix the error

Link to comment
Share on other sites

Why do i get an error at mod.ItemRuby.itemID

 

Because IDs aren't used any more.

 

Not having dug into 1.7 yet myself all I know is that you're doing it wrong.  Check vanilla ores like diamond or coal.

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

Why do i get an error at mod.ItemRuby.itemID

 

  Check vanilla ores like diamond or coal.

 

I found this piece od code wich i found in BlockRedstoneOre.java.patch

public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)

    {

        super.dropBlockAsItemWithChance(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_6_, p_149690_7_);

    }

 

    {{{{{    if}}}}}} (this.getItemDropped(p_149690_5_, p_149690_1_.rand, p_149690_7_) != Item.getItemFromBlock(this))

    private Random rand = new Random();

        private Random rand1 = new Random();

            @Override // World, meta, fortune

            public int getExpDrop(IBlockAccess p_149690_1_, int p_149690_5_, int p_149690_7_)

            {

                if (this.getItemDropped(p_149690_5_, rand, p_149690_7_) != Item.getItemFromBlock(this))

                {

                    int j1 = 1 + p_149690_1_.{{{{{{{{rand}}}}}}.nextInt(5);

                    return 1 + rand.nextInt(5);

                }

                return 0;

            }

 

 

i just copyed it and it gives me errors 0.0  i have marked the errosrs in these things {{{{{{ }}}}}} not that i dont know java i'm just not experienced enough to find the problem .

Link to comment
Share on other sites

Did you import it? is "mod" your main class file name? Remove the .itemID?

 

I did try to remove .itemID and it gives error

you can change the method  return type to item (wich doesnt work)

and you can change type of itemRuby to an Int (wich gives errors in your main modding class)

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.