Jump to content

Damageing item


muddyfish

Recommended Posts

Hello, I am trying to make a custom item that can pick up a type of block and store it.

Currently, when I use it, the log displays 0 15 when it try's to pick it up.

The damage bar appears for a tick then disappears. I assume this means the damage is being reset.

I don't know if this matters, but the item has nbt

 

Code: (In onItemRightClick)

            		int damage = itemStack.getItemDamage();
            		itemStack.setItemDamage(damage + 16-world.getBlockMetadata(x, y, z));
            		log.info(damage+" "+itemStack.getItemDamage());

 

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.



×
×
  • Create New...

Important Information

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