InteractInventoryEvent.Open not firing for PlayerInventory?

@Listener
public void onOpen(InteractInventoryEvent.Open event, @First Player player) {
    if (event.getTargetInventory().getArchetype() == InventoryArchetypes.PLAYER) {
        event.setCancelled(true);
    }
}

I have the above listener. With some logger checks, I have confirmed it is called when a Chest is opened, but that it is not called whenever the player opens their creative or survival inventory (in this case, it doesn’t even make it to the if statement, the listener simply isn’t called). Is there a different event for this?

(Minecraft 1.12.2, SpongeAPI 7.1.0, SpongeVanilla)

Edit: just verified it also does not work on the recommended SpongeForge build

Edit 2: it looks like the Close event works properly

Edit 3: verified no child of TargetInventoryEvent is called when the player opens their inventory

The open inventory event does not fire when the player inventory is opened because minecraft doesnt tell the server when the player inventory opens anymore, I believe they removed it in MC 1.9, maybe wrong on the version.

Because the minecraft client doesnt tell the server, sponge can not use it sadly

Okay, I’m trying to find a work-around, but the following:

@Override
public void run() {
    Sponge.getServer().getOnlinePlayers().forEach(p -> {
        p.getOpenInventory().ifPresent(c -> {
            if (c.getArchetype() == InventoryArchetypes.PLAYER) {
                System.out.println("closing");
                p.closeInventory();
            }
        });
    });
}

Tries to close the player’s inventory even if it isn’t open (which isn’t a big problem). The problem is, p.closeInventory() also closes the text bar and the menu, which is really weird.

Text bar and menu? I dont know what you mean by them?

chat bar and pause menu (pressing t or enter)

Basically trying to replace the player’s inventory GUI with a double chest custom inventory.

Edit: if im unable to do this by detecting the player’s inventory being open, ill probably just put an item in the hotbar and detect when the player swaps to it, essentially changing the open inventory button from e to 1 or 2

This is because closeInventory() ultimately sends a “close window” packet to the client - Protocol - wiki.vg
(The SPacketCloseWindow class).
In response to this packet the vanilla client simply closes any window currently open (interestingly a window ID is sent with the packet but the client ignores this and closes whatever is open).