Unique item ID

Discussion in 'Plugin Development' started by MissGaby, Mar 25, 2013.

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

    MissGaby

    Is it possible to assign an unique item id to an itemstack or item? I'm trying to make a special sword that doesn't look different from a regular sword (I'd like to add an insane knock back). So is it possible to assign an unique ID to a certain item? Thank you!
     
  2. Offline

    caseif

    Er... You could add ItemMeta to the ItemStack to help distinguish it. Other than that, though, I'm not sure you can add anything else to make it unique.
     
  3. Offline

    MissGaby

    What do you want me to do in the ItemMeta? You can't assign something like an ID in the ItemMeta.
     
  4. Offline

    caseif

    No, but you can assign a DisplayName or lore.
     
  5. Offline

    MissGaby

    Ah yeah, that's what I wanted to do, but then I got told it has to look identical to the original sword o....o
     
  6. Offline

    caseif

    :/
    I've got nothing. Idk, maybe I'll think of something.
     
  7. Offline

    chasechocolate

    You can save the item.getUniqueId() to a variable.
     
  8. Offline

    MissGaby

    Uhm, is that usable for ItemStacks? If so, where do I use it? It's not under the ItemStack or ItemMeta class.
     
  9. Offline

    chasechocolate

    Ah, I thought you meant an item drop. Might want to create a random integer (new Random().nextInt()) and save it in the item's ItemMeta.
     
Thread Status:
Not open for further replies.

Share This Page