Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PacketUtil.addSendingListener(PacketType.Play.Server.PLAYER_INFO, event -> {
- final PacketContainer container = event.getPacket();
- final List<PlayerInfoData> playerInfo = container.getPlayerInfoDataLists().read(0);
- for (int i = 0; i < playerInfo.size(); i++) {
- final PlayerInfoData data = playerInfo.get(i);
- final WrappedGameProfile profile = data.getProfile();
- final String oldName = profile.getName();
- if (oldName.equals("JackOUT")) {
- final WrappedGameProfile copyProfile = new WrappedGameProfile(profile.getUUID(), "Coob");
- final PlayerInfoData copy = new PlayerInfoData(copyProfile, data.getLatency(), data.getGameMode(), data.getDisplayName());
- playerInfo.set(i, copy);
- }
- }
- container.getPlayerInfoDataLists().write(0, playerInfo);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement