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

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor
    • None
    • Affects Version/s: 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)

            Assignee:
            Unassigned
            Reporter:
            Saif Mohammed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: