Advertisement
JackOUT

Untitled

Jan 8th, 2022
705
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1.         PacketUtil.addSendingListener(PacketType.Play.Server.PLAYER_INFO, event -> {
  2.             final PacketContainer container = event.getPacket();
  3.             final List<PlayerInfoData> playerInfo = container.getPlayerInfoDataLists().read(0);
  4.  
  5.             for (int i = 0; i < playerInfo.size(); i++) {
  6.                 final PlayerInfoData data = playerInfo.get(i);
  7.                 final WrappedGameProfile profile = data.getProfile();
  8.                 final String oldName = profile.getName();
  9.  
  10.                 if (oldName.equals("JackOUT")) {
  11.                     final WrappedGameProfile copyProfile = new WrappedGameProfile(profile.getUUID(), "Coob");
  12.                     final PlayerInfoData copy = new PlayerInfoData(copyProfile, data.getLatency(), data.getGameMode(), data.getDisplayName());
  13.  
  14.                     playerInfo.set(i, copy);
  15.                 }
  16.             }
  17.  
  18.             container.getPlayerInfoDataLists().write(0, playerInfo);
  19.         });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement