Item meta

Discussion in 'Plugin Development' started by ulsa, Aug 23, 2014.

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

    ulsa

    Well , guys i have a question in my mind for some time which is
    How do you give items to players that only you can craft as a plugin for detecting later

    for ex "i can't detect by name because they can rename items , I can't detect by lore aswell
    same goes for enchantments and displayname"

    so I am asking is there a special meta that we can add to make items uniique for our plugin like giving em a custom id .. or do we have to use items uuid to make it unique from all the other items
     
  2. Offline

    mine-care

    You can use metadata , read a tutorial about metadata it's unique on a item :)
     
  3. Offline

    Zupsub

    Well, how can you change the lore of an item? This is only possible with creative mod + hacked client I guess.

    However you can use NBTTags, there's a library out there, but it's a hacky way and may changed also with creative, I don't know.

    It's also possible with ProtocolLib to hide a lore (f.e. if it contains an uuid)
     
  4. Offline

    Totom3

    mine-care ItemStack does not implement Metadatable unfortunately :/

    Zupsub is right, you can't change the lore of an item, even with creative/hacked client. I'd go with hiding a lore with ProtocolLib
     
    mine-care likes this.
  5. Offline

    ChipDev

    Totom3 Zupsub
    Guys...
    Code:java
    1. ItemMeta im = YourItemStack.getItemMeta();
    2. List<String> lore = new List<String>();
    3. lore.add("Line 1");
    4. lore.add(ChatColor.GREEN + "Line 2");
    5. im.setLore(lore);
    6. YourItemStack.setItemMeta(im);

    Make a list of a string of lore lines.. and Get the item meta and add the list to it.
     
    Totom3 likes this.
  6. Offline

    Totom3

    ChipDev Ahaha go home, you're drunk (or lost (or both)) :p

    When we were saying you couldn't change the lore... we meant as a player on a server without the help of third party plugins xD
     
    mine-care likes this.
  7. Offline

    mine-care

    Totom3 lol yeah, :/ used on projectiles that accept it sorry.
     
  8. Offline

    ChipDev

    Totom3 Probz. drunk o,O
    But actually, here are the ways:
    /itemmeta
    /give
    NBTEdit
     
Thread Status:
Not open for further replies.

Share This Page