There are a few ways to get variables from a string. The easiest would be to split the command (in this case, using whitespace) or a more technical approach would be to use regex.
If they could at least fix the 100 errors from decompiling, I would be happy to write the deob tables for myself (patches as bugs are found would be nice too).
depends on what kind of item it is, for example if its a type of tool then using the onBlockDestroyed method like billythegoat101 mentioned would work nicely, if its a weapon the onEntityHit method would work better (please be more descriptive)
to answer your question, onBlockDestroyed is found in the Item class (which your item class will inherit when it extends Item), just overwrite it by putting this in your item's class:
public boolean onBlockDestroyed(ItemStack itemstack, int i, int j, int k, int l, EntityLiving entityliving)
{
itemstack.damageItem(1, entityliving);
return true;
}
again, be more descriptive, ill help you once i know the context of your problem :smile.gif:
Actually, you should be looking at ItemStack.damageItem()
It is the actual code that counts the damage and deletes the item when it runs out of uses. I recommend having it check the item's id and go from there to do what you want it to do.
Where are you from?: USA, Colorado Your age?: 20 Have you read and agreed to the rules in the post below? Yes Did you vote for us? Not yet Extra notes?: Minecraft IGN: Zanoab How did you hear of Super-Earth?: Minestatus
I was able to work around it the first time by moving all the modifications deeper so Block.java remains unmodified. I started getting it again after another few modifications to Block.java so I'm going to be doing some trial and error.
I just added some code that adds blocks that are missing stepSounds to a log and a check to skip it if null.
I only got one so far which is 30 (cobweb). Cobweb was causing problems for me last time so there must be a pattern somewhere.
I had this problem when I was messing with my Entities file as well. I tried everything (including using a debugger and realized that the sound was null) but couldn't get my file to work. I was only able to get rid of the error by getting a clean Entities file and adding the changes back in. You might have made a mistake somewhere and if worst comes to worst, add the changes back in piece by piece and find workarounds for the changes that cause it to crash.
For some reason, Entities doesn't like to be modified.
in-game name: Zanoab
location and age: Colorado, USA; 20
previous bans: None
referral: None
reason you should you be accepted: I can't think of any specific reason besides that I'm looking for my first server that I can enjoy and become part of.
information you would like to add: I don't enjoy griefing people (even if they are griefing me)
Special Key: {+bMod+}
0
0
Strings aren't callable.
0
0
I hate it when I forget to set my avatar, especially on old accounts.
0
0
0
Also, are you using an IDE?
0
Actually, you should be looking at ItemStack.damageItem()
It is the actual code that counts the damage and deletes the item when it runs out of uses. I recommend having it check the item's id and go from there to do what you want it to do.
0
0
Your age?: 20
Have you read and agreed to the rules in the post below? Yes
Did you vote for us? Not yet
Extra notes?: Minecraft IGN: Zanoab
How did you hear of Super-Earth?: Minestatus
0
I just added some code that adds blocks that are missing stepSounds to a log and a check to skip it if null.
I only got one so far which is 30 (cobweb). Cobweb was causing problems for me last time so there must be a pattern somewhere.
0
For some reason, Entities doesn't like to be modified.
0
What exactly are you trying to do?
0
- Zanoab
#2 Country and Age (this is for our demographic purposes)
- USA, 20
#3 How did you hear about us?
- Found this thread here
#4 Why do you want to Join DarkTide?
- DarkTide looks active and I've been looking for a nice server to join.
#5 Did you read and understand the rules?
- Yes and yes
#6 Have you logged on to DarkTide at least once?
- Yes
0
location and age: Colorado, USA; 20
previous bans: None
referral: None
reason you should you be accepted: I can't think of any specific reason besides that I'm looking for my first server that I can enjoy and become part of.
information you would like to add: I don't enjoy griefing people (even if they are griefing me)
Special Key: {+bMod+}