How to change item's names?

Discussion in 'Plugin Development' started by MineCrypt, Dec 24, 2012.

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


    Can someone please explain to me how you would change the name of an item with the new bukkit versions? I had it working before but now my code does not seem to work, so how can you do it now?
  2. Offline


    I think this should work, if it doesn't just tell me
    public ItemStack setName(ItemStack is, String name){
            ItemMeta m = is.getItemMeta();
            return is;
    Ahmet094 likes this.
  3. Offline


    I always use the NBTTagCompund but since the new update that gives errors: this is the new way?
  4. Offline


    I am fairly certain this is the "proper" way to do it. Editing NBTTagCompounds should still work, but I think this is easier.
  5. Offline


    Jes to add a Lore do this:
    2. ArrayList<String> lore = new ArrayList<String>();
    3. lore.add("JavaNoob!");
    4. meta.setLore(lore);
  6. Offline


    yes, since some 1.4.5 updated, al craftbukkit and nms classes have chance package names, they are doing it on every update, because most people dont follow the actual rules and use craftbukkit instead of bukkit to compile their plugin, and not addng same guards for incase the methode they relaying on have chanced name, like first there was a methode that spawns a sheep, but later it may be a methode that spawns the enderdragon after an update, whitout the plugin delevoper known it, just because "Their code compiles", so the users are going to wine to the plugin creator, and he is going to whine back to bukkit, and they to him for his foulish methode

    see the following thread for more information how they are doing the stuff whit the package names:
  7. Offline


    The bukkit ItemMeta is actually a wrapper for NBTTagCompounds, and will not be corrupted by updates. I only use CraftBukkit or NMS when it's completely necessary, which sadly happens more than I would like it to.
  8. Offline


    Alright well doing the above thing didnt seem to work :/ maybe Im adding it wrong? Or something? Idk
  9. Offline


    What is your current code?
Thread Status:
Not open for further replies.

Share This Page