Jump to content

[SOLVED][1.7.10]Item damage bugs?


deadrecon98

Recommended Posts

There is no onItemRightClick in that class file. Just a bunch of crap in onCreated.

What are you trying to achieve?

 

Whoops, sorry about that. I am working on two completely different mods right now and it is confusing me a bit. As for what I am trying to do, whenever you craft the (MagicItem) it will look at the item that you are holding. If it is an instance of ItemGlove then damage it otherwise kill the player.

For some reason however, whenever the item is "destroyed" the client doesn't get the information and just resets the damage to 0.

Link to comment
Share on other sites

First of all this and therefor this will never be true.

 

Then: This check will crash on a server. You cannot check the keyboard directly like that in common code.

 

I see what you mean for the Keyboard but that is something else completely. Just ignore that. And what do you mean when you say needsEssence will never be true? It is set to true if the object has a tag. And yes, the tag compound can be null.

Link to comment
Share on other sites

You know what onCreated does, right? It gets called when your Item gets crafted. At that point the NBTTagCompound will always be null, unless your crafting result already has NBT.

 

And that is exactly why it's there. Some of my crafting recipes already have a tag, hence it even being there.

Link to comment
Share on other sites

Actually from looking at vanilla code, damageItem does not properly destroy stacks when they reach size 0, unless they are a Bow (don't ask me why that is). So you have to check for that manually.

 

Wow, that doesn't make any sense whatsoever. Do you think you could help me out on this then? If you look at the item code you will notice that I already have this set up but I am using VERY improperly. If you could give me a few pointers that would help a ton.

Link to comment
Share on other sites

ItemCraftedEvent is a FML Event. Are you registered to the FML EventBus?

 

Yeah, every other event in that class works fine. I have tried elevating that one to a higher priority and even making it static but nothing is fixing it. I have no idea what's going on here.

Is it wrong that I registered it like: MinecraftForge.EVENT_BUS.register(new EventManager());?

Link to comment
Share on other sites

ItemCraftedEvent is a FML Event. Are you registered to the FML EventBus?

 

Yeah, every other event in that class works fine. I have tried elevating that one to a higher priority and even making it static but nothing is fixing it. I have no idea what's going on here.

Is it wrong that I registered it like: MinecraftForge.EVENT_BUS.register(new EventManager());?

 

Always... always.... register in the right event bus.

 

 

I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.