Trying to see ItemMeta of Clicked Item while Stripping Color

Discussion in 'BungeeCord Plugin Help' started by MarkIsCool, Jun 9, 2018.

  1. Hmmm, I don't think I'm doing this right.
    Currently, I'm trying to make a simple GUI.
    I'm checking to see if the item they clicked, is a certain item. If it is, then I would do the giveMageKit() or the giveWarriorKit() methods. I'm getting a ton of errors when I click them, and the if statements are simply not working. Any alternatives?

    Code (Text):

        public void onInventoryClick(InventoryClickEvent e) {

            Player player = (Player) e.getWhoClicked();

            if (!e.getInventory().getName().equals("Classes"))

            if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.stripColor("Mage"))) {
            if (e.getCurrentItem().getItemMeta().getDisplayName().equals(ChatColor.stripColor("Warrior"))) {


  2. What are the errors that you get? Please show us the stacktrace.
  3. Here is the error:
  4. Which one is line 124?
    • Like Like x 1
  5. You need to check "getCurrentItem" for null.