Solved Get an Int from lore

Discussion in 'Plugin Development' started by user_91277742, Oct 6, 2018.

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


    hello there!, So.. i just want to know, how can i get an int from the lore of an custom item.
    Example... "Uses: 6"
  2. Offline


    On thé itemStack

    ItemMeta meta = someItemstack.getMeta();
    lore = meta.getLore()

    Verstuurd vanaf mijn ONEPLUS A3003 met Tapatalk
  3. Offline


    But... how can i get the number in the lore?
  4. Offline


    Possibly loop through the lines, use a regex pattern to get the number from the string. Check that out: will give you a number string (like "4"), simple parse it with Integer#parseInt() or whatever wrapped class you want

    Sent from my TRT-L21A using Tapatalk
  5. Offline


    thanks to all <3
Thread Status:
Not open for further replies.

Share This Page