Spigot 1.16 InventoryClickListener

Discussion in 'Plugin Development' started by MiBB3L, Feb 12, 2021.

  1. Offline


    I have a problem with my InventoryClickListener it works fine, but everytime a Player swaps an Item in his inventory its printing an error code. To fix that I made this if-statement but it seems to not work

    if(event.getView().getType().equals(player.getInventory().getType())) {
    I worked with 1.8 Spigot before, so I donĀ“t know if there are any other solutions in the 1.16 Spigot for my problem.

    @timtower help me please

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Feb 12, 2021
  2. Offline


    Show the error and the code.
  3. Offline


  4. Offline


    It'd have been better had you not cropped the file; now we have no way of correlating the HB line numbers to the real line numbers to know what line is 39. Which is it?
  5. Offline


    listener(39) = hastebin(19)

    String name = item.getItemMeta().getDisplayName();
  6. Offline


    @MiBB3L itemMeta of the item is null. Replace hasItemMeta with getItemMeta == null in your checks.

Share This Page