CodeRida

Untitled

Apr 18th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1.  
  2. ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(Reflex.getInstance(),
  3. ListenerPriority.NORMAL,
  4. PacketType.Play.Client.CLIENT_COMMAND) {
  5. @Override
  6. public void onPacketReceiving(PacketEvent event) {
  7. if (event.getPacketType() == PacketType.Play.Client.CLIENT_COMMAND) {
  8. final PacketContainer packet = event.getPacket();
  9. final ClientCommand action = packet.getClientCommands().read(0);
  10. if (action == ClientCommand.OPEN_INVENTORY_ACHIEVEMENT) {
  11. //Code goes here
  12. }
  13. }
  14. }
  15. });
Advertisement
Add Comment
Please, Sign In to add comment