Removing/not displaying item name

Discussion in 'Plugin Development' started by Rixterz, Nov 21, 2015.

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

    Rixterz

    Hi,

    Is there a way to remove an item's name so the description box doesn't show up when the user mouses-over it?

    [​IMG]

    That glass is a filler item for the inventory, and yes, for irrelevant reasons it absolutely must be there.

    I thought about settings its name to ChatColor.BLACK + name but that'd still show the box.

    Ideally I wouldn't want to check every single mouseover event and cancel the box-showing (if that is even possible) because of lag.

    -Rix
     
  2. Offline

    CraftCreeper6

    @Rixterz
    New ItemStack with "" as name?
     
    Zombie_Striker likes this.
  3. Offline

    Rixterz

    Like this? Tried it and it doesn't work:
    Code:
    ItemMeta meta = iS.getItemMeta();
           
            meta.setDisplayName(name);
           
            iS.setItemMeta(meta);
     
  4. Offline

    CraftCreeper6

    @Rixterz
    Well, replace the "name" param with " "
     
  5. Offline

    Xerox262

    Why place the glass panes at all?
     
  6. Offline

    Rixterz

    That's closer to what I want, but the box still shows.
     
  7. Offline

    Xerox262

    It's always gonna show the box unless you don't place an item there
     
  8. Offline

    SuperSniper

    @Rixterz The box is going to show no matter what, as @Xerox262 explained above. If you don't want the box to show, remove the item in the slot completely. The best thing you can get is setting the itemname to null or ""
     
  9. Offline

    Scimiguy

    @SuperSniper
    Probably wouldn't advise setting the name to null
     
  10. Offline

    Mrs. bwfctower

    There wouldn't be a problem with setting it to null. All internal methods using it check that there is a display name, which has a null check. And any proper plugin would also check for it.
     
  11. Offline

    Xerox262

    I just checked because of his post, I knew it wouldn't cause any problems, however setting a item name to null just returns it to the normal name.
    @Scimiguy
     
    Scimiguy and Mrs. bwfctower like this.
  12. Offline

    Mrs. bwfctower

    Ah, ok.
     
Thread Status:
Not open for further replies.

Share This Page