Item tooltip

Discussion in 'Plugin Development' started by Johnson1893, Feb 19, 2020.

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

    Johnson1893

    Is any way to adding custom tooltip line to item without client modifications?
    I need to add description to banned/restricted item.
    Thanks!
     
  2. Offline

    Kars

    PHP:
    ItemStack stack = new ItemStack(Material.STONE1);
    ItemMeta meta stack.getItemMeta();
    ArrayList<Stringlore = new ArrayList<String>();
    lore.add("This is a line of description.");
    lore.add("This is a second line.");
    meta.setLore(lore);
    stack.setItemMeta(meta)
     
    Johnson1893 likes this.
  3. Offline

    Johnson1893

    In which event can this be added?
     
  4. Offline

    timtower Administrator Administrator Moderator

    Where ever you want an item to get a tooltip.
     
  5. Offline

    Johnson1893

    I need that on all clients connected to my server, the item I need (let it be a stone) should display the line I need in the tooltip. And all this without third-party mods on the client side - only on the server. I once met such functionality.
     
  6. Offline

    Kars

    You add this wherever the player receives the stone. So where you add 'stack' into their inventory.
     
    Johnson1893 likes this.
Thread Status:
Not open for further replies.

Share This Page