Lets just say I'm creating some copper ore. To make the block drop itself for later smelting would be as simple as telling it to drop it's ID? Also, what if I wanted this block to have a small chance of dropping a piece of turquoise? How would I implement that?
Well, I do not know about your second request, but in order to make it drop itself simply use the code below.
public int idDropped(int i, Random rand, int j)
{
return blockID;
}
The blockID basically means the ID of the block you are currently in, which means if you return the blockID, you will always get the class you put it in.
EDIT: Just saw your second post right now, so nevermind. Atleast the final part might be, slightly useful.
EDIT 2: Actually, if you use rand as well as two if statements you should be able to do that, albeit it might be slightly hard to understand.
EDIT 3: Wait, after looking at it a bit more, do you want it to have a chance to drop, say, copper ore or turquoise, or do you want it to have a small chance to drop, say, copper ore and turquoise?
I suppose you want them both at a time, which, as I said above, might be hard.
The blockID basically means the ID of the block you are currently in, which means if you return the blockID, you will always get the class you put it in.
EDIT: Just saw your second post right now, so nevermind. Atleast the final part might be, slightly useful.
Well, I was still unsure about the blockID part, so you clarified that for me, regardless! Thanks!Yeah, I meant that I'd like for there to be a small chance that turquoise is dropped WITH the copper. This is still my first week of coding, and my mentor isn't on at the moment. I wanted to try to do something on my own haha... If you have the slightest inkling as to what the statement would look like, however, I'd love to see it. I've yet to create the turquoise item, but I know how to do so, or at least I think I do.
Well, I was still unsure about the blockID part, so you clarified that for me, regardless! Thanks!
Yeah, I meant that I'd like for there to be a small chance that turquoise is dropped WITH the copper. This is still my first week of coding, and my mentor isn't on at the moment. I wanted to try to do something on my own haha... If you have the slightest inkling as to what the statement would look like, however, I'd love to see it. I've yet to create the turquoise item, but I know how to do so, or at least I think I do.
To be honest, due to the way the method works, I am pretty sure you can not return two things in a single method. I got a idea on my mind that might work, but the chance is pretty low. I will test it out right now.
To be honest, due to the way the method works, I am pretty sure you can not return two things in a single method. I got a idea on my mind that might work, but the chance is pretty low. I will test it out right now.
Hey, thanks for at least trying to help! Its all I could ask for
Hey, thanks for at least trying to help! Its all I could ask for
The way I thought is impossible, but there should be one way, which, if it worked, would need you to make a entirely new method, designed specially to drop a extra item. I am only, like before, thinking it would work.
EDIT: In the worst case, you might even have to maybe change the base classes, but due to only mediocre modding skills, I am only guessing.
The way I thought is impossible, but there should be one way, which, if it worked, would need you to make a entirely new method, designed specially to drop a extra item. I am only, like before, thinking it would work.
EDIT: In the worst case, you might even have to maybe change the base classes, but due to only mediocre modding skills, I am only guessing.
Hmmm, I'll look into it further. If I can figure it out, or if my mentor can help me with it, would you like to see the end-result?
@Override
public int idDropped(int par1, Random par2Random, int par3) {
return blockID ;
That should make it drop itself, yeah? Well... what about if I want to add a drop (much like lapis) but only at a small % of doing so?
Well, I do not know about your second request, but in order to make it drop itself simply use the code below.
public int idDropped(int i, Random rand, int j)
{
return blockID;
}
The blockID basically means the ID of the block you are currently in, which means if you return the blockID, you will always get the class you put it in.
EDIT: Just saw your second post right now, so nevermind. Atleast the final part might be, slightly useful.
EDIT 2: Actually, if you use rand as well as two if statements you should be able to do that, albeit it might be slightly hard to understand.
EDIT 3: Wait, after looking at it a bit more, do you want it to have a chance to drop, say, copper ore or turquoise, or do you want it to have a small chance to drop, say, copper ore and turquoise?
I suppose you want them both at a time, which, as I said above, might be hard.
Well, I was still unsure about the blockID part, so you clarified that for me, regardless! Thanks!Yeah, I meant that I'd like for there to be a small chance that turquoise is dropped WITH the copper. This is still my first week of coding, and my mentor isn't on at the moment. I wanted to try to do something on my own haha... If you have the slightest inkling as to what the statement would look like, however, I'd love to see it. I've yet to create the turquoise item, but I know how to do so, or at least I think I do.
To be honest, due to the way the method works, I am pretty sure you can not return two things in a single method. I got a idea on my mind that might work, but the chance is pretty low. I will test it out right now.
Hey, thanks for at least trying to help! Its all I could ask for
The way I thought is impossible, but there should be one way, which, if it worked, would need you to make a entirely new method, designed specially to drop a extra item. I am only, like before, thinking it would work.
EDIT: In the worst case, you might even have to maybe change the base classes, but due to only mediocre modding skills, I am only guessing.
Hmmm, I'll look into it further. If I can figure it out, or if my mentor can help me with it, would you like to see the end-result?
Sure. I am currently trying to make that method myself, but I am still not experienced enough. So do not expect any more useful help from me,
Hey, its no problem! thanks for trying thought, right?
Of course! I should have thought to look up something else that drops two items- The cow!
Thank you immensely!
Wait, so how would I just make it so there is a small random% that it would only drop 1 item?