Why is my lore null?

Discussion in 'Spigot Plugin Development' started by NaJated, Jun 25, 2016.

  1. Read the thread again. I added a new piece of code.
     
  2. Youre still not adding a lore, so lore == null
     
  3. There, added last piece of code haha
     
  4. lore.add(ChatColor.AQUA + enchant + " " + RomanNumeral.representationOf(1));
    What is RomanNumeral and enchant?
     
  5. Read post.
     
  6. I think that converts numbers to roman numerals, so 1 would be I, two eould be II, fifteen XV
     
  7. Code (Text):
    lore.add(ChatColor.AQUA + enchant + " " );
    Try that, if that goes right, the romannumeral is the error creator
     
  8. Same error :(
     
  9. Where exactly is line 297 in the Listeners class?
     
  10. You are automatically assuming that the item stack has lore, which will not some times, so you need to do a check with ItemStack#hasItemMeta(); and ItemStack#getItemMeta()#hasLore()