Code: target.sendPluginMessage(plugin, "myplugin:packetname", data.toString().getBytes(StandardCharsets.UTF_8)); data is JSONObject converted to string When the command that sends this packet is executed, the player is thrown from the server with an error. Code: Player lost connection: Internal Exception: io.netty.handler.codec.DecoderException: java.io.IOException: Bad packet id 123 I'm using Paper server
You are sending a packet that the client can't deal with and so the player is kicked. You can't just send a random packet and expect things to work out; there's a protocol you have to adhere to.