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

InventoryClickEvent not properly tracking item movement with InventoryAction.HOTBAR_SWAP

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • None
    • git-Spigot-988b411-1f4693a, 1.16.3-R0.1-SNAPSHOT
    • Yes

      When using InventoryAction.HOTBAR_SWAP in InventoryClickEvent, there is no way to get the other item. I set up a simple test plugin to show the items gettable from the click event (#getCurrentItem and #getCursor), and both are empty when swapping an item from the hotbar to any open inventory slot.

       

      @EventHandler
      public void onSwap(InventoryClickEvent evt) {
         if (evt.getAction() == InventoryAction.HOTBAR_SWAP)

      {      evt.getWhoClicked().sendMessage(evt.getCurrentItem().toString());      evt.getWhoClicked().sendMessage(evt.getCursor().toString());    }

      }

       

      It would be beneficial to be able to get the item coming into the slot your mouse is over when you swap.

            Unassigned Unassigned
            gecko10000 gecko10000
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: