1.8.8 Item GUI dont Open

Discussion in 'Spigot Plugin Development' started by letzYassineTvYT, Mar 16, 2020.

  1. libraryaddict

    Patron

    Try debugging.
    For example,
    System.out.println(e.getItem().getItemMeta().getDisplayName()); - Find what name the item is
    System.out.println(name.equals("§2•§a● Einstellungen §8∎ §7Rechtsklick")) - Will be true if they're equal

    Basically, you should do debug output to find out what you're getting, what you're receiving. There's a possibility of an invisible character.
    It's also worth noting that I'd personally store the item and use e.getItem().isSimilar(item)
    As you're referencing the item name a lot, it may also be worth storing it as a variable so you don't constantly call "e.getItem().getItemMeta()..."
    Instead String name = e.getItem().getName();
    Then you could just use name.equals("Sdfsddgsgs")
     
  2. I did but it also dont work
     
  3. The code is a bit confused but as libraryaddict said, try debugging, for example:

    Try to do an output to check if the item is null while clicking, or if it cannot create the inventory, or if you created another event that collapse your main code, etc...

    I'm here to help, for any questions send a message :)