ItemStack.setAmount(int); Not working - either does lore

Discussion in 'Plugin Development' started by Zarkopafilis, Jun 11, 2014.

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

    Zarkopafilis

    Code:
    ItemStack tr_smg = new ItemStack(Material.CLAY_BRICK, 1);
    ItemMeta amm = tr_smg.getItemMeta();
    amm.setDisplayName("title");<--This works
    List<String> lr = new ArrayList<String>();
    lr.add("lore");
    amm.setLore(amm);<--Lore doesnt display
    tr_smg.setItemMeta(amm);
    When I try to set amount via tr_smg.setAmount(30); before editing meta , I end up with 2 bricks
     
  2. Offline

    1Rogue

    You're passing your ItemMeta to #addLore, not your String list
     
    AdamQpzm and Garris0n like this.
  3. Offline

    Zarkopafilis

    Ι dont get it
     
  4. This is wrong.
     
  5. Offline

    Zarkopafilis

    How to fix it?
     
  6. Offline

    L33m4n123

    you have to pass the lore there and not the ItemMeta
     
  7. Offline

    Zarkopafilis

    Aw damn its a typo , I had done it again and i was like wtf is going on!
     
Thread Status:
Not open for further replies.

Share This Page