Item Identification

Discussion in 'Plugin Development' started by Jakeob22, Aug 31, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Jakeob22

    I know entities have a UUID so you can save information about them or keep track of it. Is there any way to do something similar with an item, for example, a diamond sword?
     
  2. Offline

    Dudemister1999

    I've heard serialization is good for that purpose. Check ItemStack's serialize().
     
    Jakeob22 likes this.
  3. Offline

    Jakeob22

    Thank you, will do. :)
     
  4. Offline

    Dudemister1999

    No problem!
     
  5. Offline

    Jakeob22

    Hm. I'm getting the same serialize value for every gold pickaxe I try. :(
     
  6. Offline

    hintss

    yes.
     
  7. Offline

    Jakeob22

    I love the trolling on this website. :D
    My question was how to tell the difference between 2 items even if they are of the same type. For example, an arrow's UUID is unique even when compared to other arrows.
     
  8. Offline

    hintss

    You either keep track of it yourself, or you set a name or something on it and check for that.
     
  9. Offline

    Jakeob22

    To keep track of it myself I would need to keep track of a bunch of different events about Inventory. I guess I could try doing a name change on it.
     
  10. Offline

    Zupsub

    Several options:

    -Set a (unique) custom display name
    -Add / Set a unique lore
    (- and hide it for the client through ProtocolLib)

    -Use NBT tags (needs nms or a nice library... if I remember right Comphenix made one...)

    Display names might be changed through anvil, NBT/Lores maybe with modded client and creative (not sure).
     
    Jakeob22 likes this.
Thread Status:
Not open for further replies.

Share This Page