Skip to content

Completely custom CUSTOM_PAYLOAD #3584

@iseal56

Description

@iseal56

Make sure you're doing the following

  • You're using the latest build for your server version
  • This isn't an issue caused by another plugin
  • You've checked for duplicate issues
  • You didn't use /reload

Describe the question
I'm making a plugin that interacts with an optional client mod through custom packets. Unfortunately, the type PacketType.Play.Server.CUSTOM_PAYLOAD requires a CustomPacketPayload instead of the standard strings / MinecraftKeys. How do I create a payload? (That class does not exist in the paper api, I got it from fabric server decompilation) How do I apply that payload to the packet, possibly in a cross-version compatible way?

API method(s) used
new PacketContainer(PacketType.Play.Server.CUSTOM_PAYLOAD)
PacketContainer#getMinecraftKeys()#write(...)
PacketContainer#getStrings()#write(...)

Expected behavior
A packet gets written and sent

Code
I have no working code currently

Additional context
Latest version of ProtocolLib available (5.4.0), minecraft version 1.21.1

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