Setting item lore

Discussion in 'Plugin Development' started by _ningattes369, Dec 1, 2021.

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


    Trying to set the item lore of an item in a pop-up punishment GUI (for banning and muting players, clicking on the "reasons" which are blocks in this inventory). This is my code:

    void setSlot(int slot, Material block, String punishment, int punishmentLength, String description) {
        this.slot[slot] = new ItemStack(block);
    there's prolly some stuff I messed up here but I'm new to java so I'll figure it out sooner or later. just need help with the context though.

    thanks !!:)
    Last edited by a moderator: Dec 2, 2021
  2. Online

    timtower Administrator Administrator Moderator

    @_ningattes369 Get the metadata, change it, set it to the item again.
  3. Offline


    ItemMeta A_ItemMeta = YourItem.getItemMeta();
    A_ItemMeta.setLore("your lore");
    // other code about meta
Thread Status:
Not open for further replies.

Share This Page