Исходник Переделаный ClickPearl Expensive 3.1 Ready

Начинающий
Статус
Оффлайн
Регистрация
8 Июл 2023
Сообщения
13
Реакции[?]
0
Поинты[?]
0

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

Взято из моей говно пасты не ебите меня палкой пж

сам ClickPearl
ClickPearl:
package ru.client.functions.impl.player;

import com.google.common.eventbus.Subscribe;

import ru.client.events.*;
import ru.client.functions.api.Category;
import ru.client.functions.api.Function;
import ru.client.functions.api.FunctionRegister;
import ru.client.functions.settings.impl.BindSetting;
import ru.client.functions.settings.impl.ModeSetting;
import ru.client.utils.client.ClientUtil;
import ru.client.utils.math.StopWatch;
import ru.client.utils.player.InventoryUtil;
import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerPacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.util.Hand;

@FieldDefaults(level = AccessLevel.PRIVATE)
@FunctionRegister(name = "ClickPearl", type = Category.Player)
public class ClickPearl extends Function {
    final ModeSetting mode = new ModeSetting("Тип", "Пакетный", "Пакетный", "Легитный");
    final BindSetting pearlKey = new BindSetting("Кнопка", -98);
    final InventoryUtil.Hand handUtil = new InventoryUtil.Hand();
    final ItemCooldown itemCooldown;
    long delay;
    final StopWatch waitMe = new StopWatch();
    final StopWatch stopWatch = new StopWatch();
    final StopWatch stopWatch2 = new StopWatch();
    public ActionType actionType = ActionType.START;
    Runnable runnableAction;
    int oldSlot = -1;

    public ClickPearl(ItemCooldown itemCooldown) {
        this.itemCooldown = itemCooldown;
        addSettings(mode, pearlKey);
    }

    @Subscribe
    public void onKey(EventKey e) {
        if (e.getKey() == pearlKey.get()) {
            if (!mc.player.getCooldownTracker().hasCooldown(Items.ENDER_PEARL)) {
                final KeyBinding[] pressedKeys = {mc.gameSettings.keyBindForward, mc.gameSettings.keyBindBack, mc.gameSettings.keyBindLeft, mc.gameSettings.keyBindRight, mc.gameSettings.keyBindJump, mc.gameSettings.keyBindSprint};
                if (ClientUtil.isConnectedToServer("funtime")) {
                    if (!waitMe.isReached(400)) {
                        for (KeyBinding keyBinding : pressedKeys) {
                            keyBinding.setPressed(false);
                        }
                        return;
                    }
                }

                sendRotatePacket();

                oldSlot = mc.player.inventory.currentItem;

                if (mode.is("Обычный")) {
                    InventoryUtil.inventorySwapClick(Items.ENDER_PEARL, true);
                } else {
                    if (runnableAction == null) {
                        actionType = ActionType.START;
                        runnableAction = () -> vebatSoli();
                        stopWatch.reset();
                        stopWatch2.reset();
                    }
                }
            } else {
                ItemCooldown.ItemEnum itemEnum = ItemCooldown.ItemEnum.getItemEnum(Items.ENDER_PEARL);

                if (itemCooldown.isState() && itemEnum != null && itemCooldown.isCurrentItem(itemEnum)) {
                    itemCooldown.lastUseItemTime.put(itemEnum.getItem(), System.currentTimeMillis());
                }
            }
        }
    }

    @Subscribe
    public void onTick(TickEvent e) {
        if (runnableAction != null) {
            runnableAction.run();
        }
    }

    @Subscribe
    private void onUpdate(EventUpdate e) {
        this.handUtil.handleItemChange(System.currentTimeMillis() - this.delay > 200L);
    }

    @Subscribe
    private void onPacket(EventPacket e) {
        this.handUtil.onEventPacket(e);
    }

    [USER=1367676]@override[/USER]
    public void onDisable() {
        super.onDisable();
    }

    private void vebatSoli() {
        int slot = InventoryUtil.getInstance().getSlotInInventoryOrHotbar(Items.ENDER_PEARL, true);
        Hand hand = mc.player.getHeldItemOffhand().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != -1) {
            interact(slot, hand);
        } else {
            runnableAction = null;
        }
    }

    private void swingAndSendPacket(Hand hand) {
        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(hand));
        mc.player.swingArm(hand);
    }

    private void interact(Integer slot, Hand hand) {
        if (actionType == ActionType.START) { // начало
            switchSlot(slot, hand);
            actionType = ActionType.WAIT;
        } else if (actionType == ActionType.WAIT && stopWatch.isReached(150L)) { // какая та хуйня
            actionType = ActionType.USE_ITEM;
        } else if (actionType == ActionType.USE_ITEM) {
            sendRotatePacket();
            swingAndSendPacket(hand);
            switchSlot(mc.player.inventory.currentItem, hand);
            actionType = ActionType.SWAP_BACK;
        } else if (actionType == ActionType.SWAP_BACK && stopWatch2.isReached(300L)) { // задержка на свап обратно
            mc.player.inventory.currentItem = oldSlot;
            runnableAction = null;
        }
    }

    private void switchSlot(int slot, Hand hand) {
        if (slot != mc.player.inventory.currentItem && hand != Hand.OFF_HAND) {
            mc.player.connection.sendPacket(new CHeldItemChangePacket(slot));
            mc.player.inventory.currentItem = slot;
        }
    }

    private void sendRotatePacket() {

    }
   
    // тут переминуй на свою киллауру
   
    //      if (Expensive.getInst().getModuleManager().getHitAura().getTarget() != null) {
    //           mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, mc.player.isOnGround()));
    //       }

    public enum ActionType {
        START, WAIT, USE_ITEM, SWAP_BACK
    }
}
InventoryUtil:
public static void inventorySwapClick(Item item, boolean rotation) {
        if (InventoryHelper.getItemIndex(item) != -1) {
            int i;
            if (doesHotbarHaveItem(item)) {
                for(i = 0; i < 9; ++i) {
                    if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                        if (i != mc.player.inventory.currentItem) {
                            mc.player.connection.sendPacket(new CHeldItemChangePacket(i));
                        }

                        if (rotation) {
                           //HitAura hitAura = CheatClient.getInstance().getFunctionRegistry().getHitAura();
                           //if (hitAura.getTarget() != null) {
                                mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, false));
                            }
                        //}

                        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(net.minecraft.util.Hand.MAIN_HAND));
                        if (i != mc.player.inventory.currentItem) {
                            mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                        }
                        break;
                    }
                }
            }

            if (!doesHotbarHaveItem(item)) {
                for(i = 0; i < 36; ++i) {
                    if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                        mc.playerController.windowClick(0, i, mc.player.inventory.currentItem % 8 + 1, ClickType.SWAP, mc.player);
                        mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem % 8 + 1));
                        if (rotation) {
                            //HitAura hitAura = CheatClient.getInstance().getFunctionRegistry().getHitAura();
                            //if (hitAura.getTarget() != null) {
                                mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, false));
                            }
                        }

                        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(net.minecraft.util.Hand.MAIN_HAND));
                        mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                        mc.playerController.windowClick(0, i, mc.player.inventory.currentItem % 8 + 1, ClickType.SWAP, mc.player);
                        break;
                    }
                }
            }
    }

    public static boolean doesHotbarHaveItem(Item item) {
        for(int i = 0; i < 9; ++i) {
            mc.player.inventory.getStackInSlot(i);
            if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                return true;
            }
        }

        return false;
    }
 
Начинающий
Статус
Оффлайн
Регистрация
8 Авг 2024
Сообщения
427
Реакции[?]
3
Поинты[?]
4K
Начинающий
Статус
Оффлайн
Регистрация
11 Апр 2024
Сообщения
53
Реакции[?]
0
Поинты[?]
0
Взято из моей говно пасты не ебите меня палкой пж

сам ClickPearl
ClickPearl:
package ru.client.functions.impl.player;

import com.google.common.eventbus.Subscribe;

import ru.client.events.*;
import ru.client.functions.api.Category;
import ru.client.functions.api.Function;
import ru.client.functions.api.FunctionRegister;
import ru.client.functions.settings.impl.BindSetting;
import ru.client.functions.settings.impl.ModeSetting;
import ru.client.utils.client.ClientUtil;
import ru.client.utils.math.StopWatch;
import ru.client.utils.player.InventoryUtil;
import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerPacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.util.Hand;

@FieldDefaults(level = AccessLevel.PRIVATE)
@FunctionRegister(name = "ClickPearl", type = Category.Player)
public class ClickPearl extends Function {
    final ModeSetting mode = new ModeSetting("Тип", "Пакетный", "Пакетный", "Легитный");
    final BindSetting pearlKey = new BindSetting("Кнопка", -98);
    final InventoryUtil.Hand handUtil = new InventoryUtil.Hand();
    final ItemCooldown itemCooldown;
    long delay;
    final StopWatch waitMe = new StopWatch();
    final StopWatch stopWatch = new StopWatch();
    final StopWatch stopWatch2 = new StopWatch();
    public ActionType actionType = ActionType.START;
    Runnable runnableAction;
    int oldSlot = -1;

    public ClickPearl(ItemCooldown itemCooldown) {
        this.itemCooldown = itemCooldown;
        addSettings(mode, pearlKey);
    }

    @Subscribe
    public void onKey(EventKey e) {
        if (e.getKey() == pearlKey.get()) {
            if (!mc.player.getCooldownTracker().hasCooldown(Items.ENDER_PEARL)) {
                final KeyBinding[] pressedKeys = {mc.gameSettings.keyBindForward, mc.gameSettings.keyBindBack, mc.gameSettings.keyBindLeft, mc.gameSettings.keyBindRight, mc.gameSettings.keyBindJump, mc.gameSettings.keyBindSprint};
                if (ClientUtil.isConnectedToServer("funtime")) {
                    if (!waitMe.isReached(400)) {
                        for (KeyBinding keyBinding : pressedKeys) {
                            keyBinding.setPressed(false);
                        }
                        return;
                    }
                }

                sendRotatePacket();

                oldSlot = mc.player.inventory.currentItem;

                if (mode.is("Обычный")) {
                    InventoryUtil.inventorySwapClick(Items.ENDER_PEARL, true);
                } else {
                    if (runnableAction == null) {
                        actionType = ActionType.START;
                        runnableAction = () -> vebatSoli();
                        stopWatch.reset();
                        stopWatch2.reset();
                    }
                }
            } else {
                ItemCooldown.ItemEnum itemEnum = ItemCooldown.ItemEnum.getItemEnum(Items.ENDER_PEARL);

                if (itemCooldown.isState() && itemEnum != null && itemCooldown.isCurrentItem(itemEnum)) {
                    itemCooldown.lastUseItemTime.put(itemEnum.getItem(), System.currentTimeMillis());
                }
            }
        }
    }

    @Subscribe
    public void onTick(TickEvent e) {
        if (runnableAction != null) {
            runnableAction.run();
        }
    }

    @Subscribe
    private void onUpdate(EventUpdate e) {
        this.handUtil.handleItemChange(System.currentTimeMillis() - this.delay > 200L);
    }

    @Subscribe
    private void onPacket(EventPacket e) {
        this.handUtil.onEventPacket(e);
    }

    [USER=1367676]@override[/USER]
    public void onDisable() {
        super.onDisable();
    }

    private void vebatSoli() {
        int slot = InventoryUtil.getInstance().getSlotInInventoryOrHotbar(Items.ENDER_PEARL, true);
        Hand hand = mc.player.getHeldItemOffhand().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != -1) {
            interact(slot, hand);
        } else {
            runnableAction = null;
        }
    }

    private void swingAndSendPacket(Hand hand) {
        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(hand));
        mc.player.swingArm(hand);
    }

    private void interact(Integer slot, Hand hand) {
        if (actionType == ActionType.START) { // начало
            switchSlot(slot, hand);
            actionType = ActionType.WAIT;
        } else if (actionType == ActionType.WAIT && stopWatch.isReached(150L)) { // какая та хуйня
            actionType = ActionType.USE_ITEM;
        } else if (actionType == ActionType.USE_ITEM) {
            sendRotatePacket();
            swingAndSendPacket(hand);
            switchSlot(mc.player.inventory.currentItem, hand);
            actionType = ActionType.SWAP_BACK;
        } else if (actionType == ActionType.SWAP_BACK && stopWatch2.isReached(300L)) { // задержка на свап обратно
            mc.player.inventory.currentItem = oldSlot;
            runnableAction = null;
        }
    }

    private void switchSlot(int slot, Hand hand) {
        if (slot != mc.player.inventory.currentItem && hand != Hand.OFF_HAND) {
            mc.player.connection.sendPacket(new CHeldItemChangePacket(slot));
            mc.player.inventory.currentItem = slot;
        }
    }

    private void sendRotatePacket() {

    }
  
    // тут переминуй на свою киллауру
  
    //      if (Expensive.getInst().getModuleManager().getHitAura().getTarget() != null) {
    //           mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, mc.player.isOnGround()));
    //       }

    public enum ActionType {
        START, WAIT, USE_ITEM, SWAP_BACK
    }
}
InventoryUtil:
public static void inventorySwapClick(Item item, boolean rotation) {
        if (InventoryHelper.getItemIndex(item) != -1) {
            int i;
            if (doesHotbarHaveItem(item)) {
                for(i = 0; i < 9; ++i) {
                    if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                        if (i != mc.player.inventory.currentItem) {
                            mc.player.connection.sendPacket(new CHeldItemChangePacket(i));
                        }

                        if (rotation) {
                           //HitAura hitAura = CheatClient.getInstance().getFunctionRegistry().getHitAura();
                           //if (hitAura.getTarget() != null) {
                                mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, false));
                            }
                        //}

                        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(net.minecraft.util.Hand.MAIN_HAND));
                        if (i != mc.player.inventory.currentItem) {
                            mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                        }
                        break;
                    }
                }
            }

            if (!doesHotbarHaveItem(item)) {
                for(i = 0; i < 36; ++i) {
                    if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                        mc.playerController.windowClick(0, i, mc.player.inventory.currentItem % 8 + 1, ClickType.SWAP, mc.player);
                        mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem % 8 + 1));
                        if (rotation) {
                            //HitAura hitAura = CheatClient.getInstance().getFunctionRegistry().getHitAura();
                            //if (hitAura.getTarget() != null) {
                                mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, false));
                            }
                        }

                        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(net.minecraft.util.Hand.MAIN_HAND));
                        mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                        mc.playerController.windowClick(0, i, mc.player.inventory.currentItem % 8 + 1, ClickType.SWAP, mc.player);
                        break;
                    }
                }
            }
    }

    public static boolean doesHotbarHaveItem(Item item) {
        for(int i = 0; i < 9; ++i) {
            mc.player.inventory.getStackInSlot(i);
            if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                return true;
            }
        }

        return false;
    }
/del сливали https://yougame.biz/threads/331510/
 
Начинающий
Статус
Оффлайн
Регистрация
8 Июл 2023
Сообщения
13
Реакции[?]
0
Поинты[?]
0
это перезалив но тут я прикрепил inventoryutil не которым долбаёбам лень пролистать не много в низ
 
Начинающий
Статус
Оффлайн
Регистрация
26 Окт 2024
Сообщения
71
Реакции[?]
0
Поинты[?]
0
Взято из моей говно пасты не ебите меня палкой пж

сам ClickPearl
ClickPearl:
package ru.client.functions.impl.player;

import com.google.common.eventbus.Subscribe;

import ru.client.events.*;
import ru.client.functions.api.Category;
import ru.client.functions.api.Function;
import ru.client.functions.api.FunctionRegister;
import ru.client.functions.settings.impl.BindSetting;
import ru.client.functions.settings.impl.ModeSetting;
import ru.client.utils.client.ClientUtil;
import ru.client.utils.math.StopWatch;
import ru.client.utils.player.InventoryUtil;
import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.EnderPearlItem;
import net.minecraft.item.Items;
import net.minecraft.network.play.client.CHeldItemChangePacket;
import net.minecraft.network.play.client.CPlayerPacket;
import net.minecraft.network.play.client.CPlayerTryUseItemPacket;
import net.minecraft.util.Hand;

@FieldDefaults(level = AccessLevel.PRIVATE)
@FunctionRegister(name = "ClickPearl", type = Category.Player)
public class ClickPearl extends Function {
    final ModeSetting mode = new ModeSetting("Тип", "Пакетный", "Пакетный", "Легитный");
    final BindSetting pearlKey = new BindSetting("Кнопка", -98);
    final InventoryUtil.Hand handUtil = new InventoryUtil.Hand();
    final ItemCooldown itemCooldown;
    long delay;
    final StopWatch waitMe = new StopWatch();
    final StopWatch stopWatch = new StopWatch();
    final StopWatch stopWatch2 = new StopWatch();
    public ActionType actionType = ActionType.START;
    Runnable runnableAction;
    int oldSlot = -1;

    public ClickPearl(ItemCooldown itemCooldown) {
        this.itemCooldown = itemCooldown;
        addSettings(mode, pearlKey);
    }

    @Subscribe
    public void onKey(EventKey e) {
        if (e.getKey() == pearlKey.get()) {
            if (!mc.player.getCooldownTracker().hasCooldown(Items.ENDER_PEARL)) {
                final KeyBinding[] pressedKeys = {mc.gameSettings.keyBindForward, mc.gameSettings.keyBindBack, mc.gameSettings.keyBindLeft, mc.gameSettings.keyBindRight, mc.gameSettings.keyBindJump, mc.gameSettings.keyBindSprint};
                if (ClientUtil.isConnectedToServer("funtime")) {
                    if (!waitMe.isReached(400)) {
                        for (KeyBinding keyBinding : pressedKeys) {
                            keyBinding.setPressed(false);
                        }
                        return;
                    }
                }

                sendRotatePacket();

                oldSlot = mc.player.inventory.currentItem;

                if (mode.is("Обычный")) {
                    InventoryUtil.inventorySwapClick(Items.ENDER_PEARL, true);
                } else {
                    if (runnableAction == null) {
                        actionType = ActionType.START;
                        runnableAction = () -> vebatSoli();
                        stopWatch.reset();
                        stopWatch2.reset();
                    }
                }
            } else {
                ItemCooldown.ItemEnum itemEnum = ItemCooldown.ItemEnum.getItemEnum(Items.ENDER_PEARL);

                if (itemCooldown.isState() && itemEnum != null && itemCooldown.isCurrentItem(itemEnum)) {
                    itemCooldown.lastUseItemTime.put(itemEnum.getItem(), System.currentTimeMillis());
                }
            }
        }
    }

    @Subscribe
    public void onTick(TickEvent e) {
        if (runnableAction != null) {
            runnableAction.run();
        }
    }

    @Subscribe
    private void onUpdate(EventUpdate e) {
        this.handUtil.handleItemChange(System.currentTimeMillis() - this.delay > 200L);
    }

    @Subscribe
    private void onPacket(EventPacket e) {
        this.handUtil.onEventPacket(e);
    }

    [USER=1367676]@override[/USER]
    public void onDisable() {
        super.onDisable();
    }

    private void vebatSoli() {
        int slot = InventoryUtil.getInstance().getSlotInInventoryOrHotbar(Items.ENDER_PEARL, true);
        Hand hand = mc.player.getHeldItemOffhand().getItem() instanceof EnderPearlItem ? Hand.OFF_HAND : Hand.MAIN_HAND;

        if (slot != -1) {
            interact(slot, hand);
        } else {
            runnableAction = null;
        }
    }

    private void swingAndSendPacket(Hand hand) {
        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(hand));
        mc.player.swingArm(hand);
    }

    private void interact(Integer slot, Hand hand) {
        if (actionType == ActionType.START) { // начало
            switchSlot(slot, hand);
            actionType = ActionType.WAIT;
        } else if (actionType == ActionType.WAIT && stopWatch.isReached(150L)) { // какая та хуйня
            actionType = ActionType.USE_ITEM;
        } else if (actionType == ActionType.USE_ITEM) {
            sendRotatePacket();
            swingAndSendPacket(hand);
            switchSlot(mc.player.inventory.currentItem, hand);
            actionType = ActionType.SWAP_BACK;
        } else if (actionType == ActionType.SWAP_BACK && stopWatch2.isReached(300L)) { // задержка на свап обратно
            mc.player.inventory.currentItem = oldSlot;
            runnableAction = null;
        }
    }

    private void switchSlot(int slot, Hand hand) {
        if (slot != mc.player.inventory.currentItem && hand != Hand.OFF_HAND) {
            mc.player.connection.sendPacket(new CHeldItemChangePacket(slot));
            mc.player.inventory.currentItem = slot;
        }
    }

    private void sendRotatePacket() {

    }
  
    // тут переминуй на свою киллауру
  
    //      if (Expensive.getInst().getModuleManager().getHitAura().getTarget() != null) {
    //           mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, mc.player.isOnGround()));
    //       }

    public enum ActionType {
        START, WAIT, USE_ITEM, SWAP_BACK
    }
}
InventoryUtil:
public static void inventorySwapClick(Item item, boolean rotation) {
        if (InventoryHelper.getItemIndex(item) != -1) {
            int i;
            if (doesHotbarHaveItem(item)) {
                for(i = 0; i < 9; ++i) {
                    if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                        if (i != mc.player.inventory.currentItem) {
                            mc.player.connection.sendPacket(new CHeldItemChangePacket(i));
                        }

                        if (rotation) {
                           //HitAura hitAura = CheatClient.getInstance().getFunctionRegistry().getHitAura();
                           //if (hitAura.getTarget() != null) {
                                mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, false));
                            }
                        //}

                        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(net.minecraft.util.Hand.MAIN_HAND));
                        if (i != mc.player.inventory.currentItem) {
                            mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                        }
                        break;
                    }
                }
            }

            if (!doesHotbarHaveItem(item)) {
                for(i = 0; i < 36; ++i) {
                    if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                        mc.playerController.windowClick(0, i, mc.player.inventory.currentItem % 8 + 1, ClickType.SWAP, mc.player);
                        mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem % 8 + 1));
                        if (rotation) {
                            //HitAura hitAura = CheatClient.getInstance().getFunctionRegistry().getHitAura();
                            //if (hitAura.getTarget() != null) {
                                mc.player.connection.sendPacket(new CPlayerPacket.RotationPacket(mc.player.rotationYaw, mc.player.rotationPitch, false));
                            }
                        }

                        mc.player.connection.sendPacket(new CPlayerTryUseItemPacket(net.minecraft.util.Hand.MAIN_HAND));
                        mc.player.connection.sendPacket(new CHeldItemChangePacket(mc.player.inventory.currentItem));
                        mc.playerController.windowClick(0, i, mc.player.inventory.currentItem % 8 + 1, ClickType.SWAP, mc.player);
                        break;
                    }
                }
            }
    }

    public static boolean doesHotbarHaveItem(Item item) {
        for(int i = 0; i < 9; ++i) {
            mc.player.inventory.getStackInSlot(i);
            if (mc.player.inventory.getStackInSlot(i).getItem() == item) {
                return true;
            }
        }

        return false;
    }
будет мое
 
Сверху Снизу