Skip to content

Inventory Auto-Closes After 2–3 Seconds #268

@mayuri008

Description

@mayuri008

Description

When a player opens a custom inventory menu created with InvMenu, the inventory closes by itself after approximately 2–3 seconds without any interaction from the player. This behavior occurs unexpectedly and disrupts gameplay, making it impossible for players to interact with the inventory menu normally.


Steps to Reproduce

  1. Create an InvMenu inventory using InvMenu::create()
  2. Send or open the inventory to a player via $invMenu->send($player)
  3. Have the player open the inventory in-game
  4. Wait 2–3 seconds without interacting
  5. Observe that the inventory closes on its own

Expected Behavior

The inventory should remain open until the player manually closes it or until it is closed programmatically via plugin logic.


Actual Behavior

The inventory automatically closes itself after approximately 2–3 seconds of being open, even without any player interaction or plugin-triggered close call.


Environment

  • Minecraft version: 1.26.10 (protocol version: 944)
  • Branch: muqsit/fix-pm-5.41.0-packet-decode
  • PocketMine-MP Version: 5.42.1 (git hash: 319f3c624b21468923cecf9934077d85c4771ffe)
  • InvMenu Version: fix-pm-5.41.0-packet
  • PHP Version: 8.4.16
  • Server OS: Linux

Possible Cause

This may be related to packet handling changes introduced in PocketMine-MP 5.41.0, particularly around inventory packet decoding. A keep-open or re-send packet may not be handled correctly, causing the client or server to interpret the inventory as timed out or invalid, resulting in an automatic close.

This issue may be connected to the changes being addressed in this branch (fix-pm-5.41.0-packet-decode), suggesting a regression or incomplete fix in the packet decode pipeline.


Additional Notes

  • The issue is consistently reproducible after 2–3 seconds.
  • Closing and reopening the inventory results in the same auto-close behavior.
  • No exceptions or errors are thrown in the server console when this occurs.

Possible Fix Suggestion

Investigate whether ContainerOpenPacket, ContainerClosePacket, or related inventory synchronization packets are being incorrectly decoded or prematurely sent to the client after the 5.41.0 packet decode changes.


Please let me know if any additional logs or test cases are needed. Happy to help debug further! 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions