Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7803

InventoryClickEvent.getCurrentItem() always returns null for Anvil inventory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • OS: archlinux 6.9.4
      Java: openjdk 21.0.3 2024-04-16

    • 3871-Spigot-d2eba2c-3f9263b (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
    • Yes

      When listening for InventoryClickEvent targetting virtual Anvil inventories, the result of getCurrentItem() is always null for the result slot.
      This does not apply to normal Anvil inventories, only such opened by calling HumanEntity#openInventory():
      ```
              var anvil = Bukkit.createInventory(null, InventoryType.ANVIL, title);
              var label = new ItemStack(Material.NAME_TAG, 1);
              anvil.setItem(0, label);
              player.openInventory(anvil);
      ```

      I have set up a minimal reproduction example project: https://github.com/burdoto/SPIGOT-7803

            Unassigned Unassigned
            Kaleidox Tobias Burdow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: