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

Inventory#getViewers returns viewers that dont have the inventory open. Also has duplicates

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • This server is running CraftBukkit version 3488-Spigot-b6d12d1-d48f2d1 (MC: 1.18.2) (Implementing API version 1.18.2-R0.1-SNAPSHOT)
    • Yes

      If you open a custom inventory for a player and they close it themselves, it does not remove them from Inventory#getViewers. Everytime the inventory is reopened, a duplicate EntityHuman is added even if one is already in the list.
      This can be solved by removing the viewer on InventoryCloseEvent, however, that is just a workaround. This does not seem like the intended behaviour of the method.

       

      Below is the source code for a plugin i made to replicate the bug

      Built the latest version of 1.18.2 just to test this and the bug is still there

      Imgur: The magic of the Internet -> Console output

      minion325/BugReportPlugin (github.com)

            Unassigned Unassigned
            minion325 Saif Mohammed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: