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

Cancelled PlayerInteractEvent leaves ghost items in armor slots if an inventory was opened

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • 3904-Spigot-224dad5-1bf30a4 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT)
    • Yes

      When a PlayerInteractEvent for equipping armor via right-click is cancelled and opens an inventory, a ghost item will remain in the armor slot.

       

      Example code:

      @EventHandler
      public void handleInteract(PlayerInteractEvent event) {
          event.setCancelled(true);
          var inv = Bukkit.createInventory(null, 9);
          event.getPlayer().openInventory(inv);
      } 

      Example video: javaw_imFjJdUNgb.mp4

            Unassigned Unassigned
            StudioCode Studio Code
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: