Remove a specific Lore

Discussion in 'Spigot Plugin Help' started by Faring, Jun 3, 2017.

  1. Hello, I currently have a plugin that includes gems that will allow players to have certain effects/abilities if they have the said Gem applied.

    While I was finalizing a speed II gem, I noticed that the user can apply speed II but then they could also have Speed I still on the tool..

    Meaning it'd look something like this, "Speed I Applied" "Speed II Applied" on the same tool.. Hmm

    Currently I have a list of strings based off the Gems. Could I have help fixing this? Is it possible to remove a specific lore?

    Code (Text):

    String HASTE = ChatColor.YELLOW + "Quickdraw I", HASTE2 = ChatColor.YELLOW + "Quickdraw II", HASTE3 = ChatColor.YELLOW + "Quickdraw III"
    That is just a snippet to show how this works.
  2. I would make a new array list, iterate over each line and if it contains one of what you specified above to ignore the line and add to the arraylist.

    After set the lore to the new list above.