Get inventory viewers

Hi. I’m trying to get the list of the viewers of a container. I get the container instance from the InteractInventoryEvent.Open event.
Even if two players are viewing the same container, the Container.getViewers() method returns only the player who triggered the event.
Is there any other way to get the inventory viewers?

Its probably an issue on sponges end, make a report.

In the meantime you could get all players around the one who fired the Event and then check if the carrier object is the same (as in the block/entity that the inventory is connect to) as you can normally make the assumption that every entity or block have a single inventory until sponge fix the issue?

2 Likes

Yea I did something similar. Where do I have write the report?

Thats the best place for it probably. Either that or SpongeCommon branch

You must be a genius

1 Like