Looking at the following packet I am having a listener to: I am trying to get the Position Byte. I have tried a lot, but I don't really understand ProtocolAPI's Packet class. Here is what I have so far Code (Java): ProtocolLibrary.getProtocolManager().addPacketListener( new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Server.CHAT) { @Override public void onPacketSending(PacketEvent event) { String message = event.getPacket().getChatComponents().getValues().get(0).getJson(); System.out.println(message); } } );
In newer versions ProtocolLib has an enum for this Code (Java): public ChatType getChatType() { return handle.getChatTypes().read(0); } public void setChatType(ChatType type) { handle.getChatTypes().write(0, type); } Otherwise you just read/write the byte at the first index