Skip to content

IllegalStateException on Play.Server.BUNDLE with MONITOR listener: ProtocolLib attempts to cancel read-only PacketEvent #3603

@zLvkas

Description

@zLvkas
  • This issue is not solved in a development build

Describe the bug
When a plugin registers a ProtocolLib sending listener on PacketType.Play.Server.BUNDLE with ListenerPriority.MONITOR, ProtocolLib throws IllegalStateException: The packet event is read-only. during outbound processing.

To Reproduce
Steps to reproduce the behavior:

  1. Register a PacketAdapter for sending with ListenerPriority.MONITOR and include PacketType.Play.Server.BUNDLE in the whitelist (or use PacketType.values()).
  2. Trigger normal gameplay actions that cause bundled outbound packets. (In my case, just cancel the PlayerItemConsumeEvent)

Expected behavior
ProtocolLib should not attempt to cancel a read-only event, or should avoid this MONITOR/read-only conflict in the internal BUNDLE handling path.

Version Info
https://just-paste.it/Qk2807a7dp

Additional context
Code: https://just-paste.it/Nx2il2q2ri

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions