Fabric API

Fabric API

111M Downloads

Payload "minecraft:brand" isn't registered

Closed this issue ยท 2 comments

commented

Well, I have the next receiver:

ServerPlayNetworking.registerGlobalReceiver(BrandCustomPayload.ID) { payload, context -> ...

And when running, Minecraft server outputs the next error:

Caused by: java.lang.IllegalArgumentException: Cannot register handler as no payload type has been registered with name "minecraft:brand" for SERVERBOUND PLAY

I think "minecraft:brand" should be registered.

commented

You are expected to register all custom payloads, including built-in ones.

commented

Ok, it should be registered like this:

PayloadTypeRegistry.playC2S().register(BrandCustomPayload.ID, BrandCustomPayload.CODEC)

But then, when registering a global receiver like this:

ServerPlayNetworking.registerGlobalReceiver(BrandCustomPayload.ID) { payload, context ->

callback is never executed. That's a expected behaviour?