public static sendPacket(Player player) {
EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
// 你要发送的数据
byte[] bytes = "这是数据啊".getBytes(StandardCharsets.UTF_8);
PacketDataSerializer serializer = new PacketDataSerializer(Unpooled.wrappedBuffer(bytes));
PacketPlayOutCustomPayload packet = new PacketPlayOutCustomPayload("mychannel", serializer);
entityPlayer.playerConnection.sendPacket(packet);
}