Jump to content

[1.7.10] [SOLVED] Why are my items changing metadata on pickup?


Recommended Posts

Posted

I'm working on a n item with 16 colour metadatas based on the 16 block colours. For some reason, however, if I have, for example, a green one in my inventory and pick up a purple one, the purple one will get picked up as a green one. So instead of a purple item being added to my inventory, the itemstack that contains the green item will increase in stack size by 1. This also occurs when using /give, however I believe that the give command uses item pick up code, so that doesn't shock me.

 

My Item Code:

http://pastebin.com/S1Q54GpG

 

If you need to see any other code, let me know. Do I have to use some sort of workaround? Am I doing something wrong? Has this happened to anyone else?

Posted

You need to call

setHasSubtypes(true)

on your

Item

, otherwise the metadata will be ignored when the player picks it up.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.