Исходник Простенький autosoup с рефиллом на версию 1.12.2 (Rich ready)

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

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

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

Спасибо!

Написал автосуп с рефиллом в свою пасту рича (рефилл может не обходить античиты, например intave или работать криво), bowl не выкидывает, та и пофиг. Кушает суп от 1 до 20 хп. Создал ещё новую категорию в feature - world. Ну лан юзайте, ес чо пишите, подскажу.

Java:
package fun.rich.client.feature.impl.world;

import net.minecraft.init.Items;
import net.minecraft.inventory.ClickType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;

import fun.rich.client.event.EventTarget;
import fun.rich.client.event.events.impl.player.EventPreMotion;
import fun.rich.client.feature.Feature;
import fun.rich.client.feature.impl.FeatureCategory;
import fun.rich.client.ui.settings.impl.NumberSetting;

public class AutoSoup extends Feature {
    private static final int HOTBAR_SIZE = 9;
    private boolean isActive;
    public static NumberSetting health;
    private int lastSlot = -1;

    public AutoSoup() {
        super("AutoSoup", "Кушает mushroom stew при определенном хп", FeatureCategory.World);
        health = new NumberSetting("Health Amount", 15, 1, 20, 1, () -> true);
        addSettings(health);
    }

    @EventTarget
    public void onUpdate(EventPreMotion eventUpdate) {
        this.setSuffix("" + (int) health.getNumberValue());
        if (mc.player == null || mc.world == null)
            return;

        int stewSlot = findStewInHotbar();
        if (stewSlot == -1) {
            // No stew in hotbar, check inventory
            stewSlot = findStewInInventory();
            if (stewSlot != -1) {
                // Stew found in inventory, move it to hotbar
                moveItemToHotbar(stewSlot);
            }
        }

        ItemStack heldItem = mc.player.getHeldItemMainhand();
        if (heldItem.getItem().isDamageable() && heldItem.getItemDamage() >= heldItem.getMaxDamage() - 5) {
            // The currently held item is almost broken, switch to a new one
            int newSlot = findStewInHotbar();
            if (newSlot != -1) {
                switchToSlot(newSlot);
            }
        }

        if (mc.player.getHealth() <= health.getNumberValue()) {
            isActive = true;
            if (mc.player.getHeldItem(EnumHand.MAIN_HAND).getItem() == Items.MUSHROOM_STEW) {
                mc.rightClickMouse();
            } else if (stewSlot != -1) {
                switchToSlot(stewSlot);
            }
        } else if (isActive) {
            mc.playerController.onStoppedUsingItem(mc.player); // Stop using the current item
            isActive = false;
            if (lastSlot != -1) {
                switchToSlot(lastSlot);
                lastSlot = -1;
            }
        }
    }

    private int findStewInHotbar() {
        for (int i = 0; i < HOTBAR_SIZE; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == Items.MUSHROOM_STEW) {
                return i;
            }
        }
        return -1;
    }

    private int findStewInInventory() {
        for (int i = HOTBAR_SIZE; i < mc.player.inventory.getSizeInventory(); i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == Items.MUSHROOM_STEW) {
                return i;
            }
        }
        return -1;
    }

    private void moveItemToHotbar(int slot) {
        if (slot < HOTBAR_SIZE) {
            return;
        }
        int firstEmptyIndex = findFirstEmptyHotbarSlot();
        if (firstEmptyIndex == -1) {
            return;
        }

        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, firstEmptyIndex, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
    }

    private int findFirstEmptyHotbarSlot() {
        for (int i = 0; i < HOTBAR_SIZE; i++) {
            if (mc.player.inventory.getStackInSlot(i).isEmpty()) {
                return i;
            }
        }
        return -1;
    }

    private void switchSlots(int slot1, int slot2) {
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot1, 0, ClickType.PICKUP,
                mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot2, 0, ClickType.PICKUP,
                mc.player);
    }

    private void switchToSlot(int slot) {
        if (lastSlot == -1 && mc.player.inventory.currentItem != slot) {
            lastSlot = mc.player.inventory.currentItem;
        }
        mc.player.inventory.currentItem = slot;
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
1 Окт 2022
Сообщения
211
Реакции[?]
2
Поинты[?]
1K
Написал автосуп с рефиллом в свою пасту рича (рефилл может не обходить античиты, например intave или работать криво), bowl не выкидывает, та и пофиг. Кушает суп от 1 до 20 хп. Создал ещё новую категорию в feature - world. Ну лан юзайте, ес чо пишите, подскажу.

Java:
package fun.rich.client.feature.impl.world;

import net.minecraft.init.Items;
import net.minecraft.inventory.ClickType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;

import fun.rich.client.event.EventTarget;
import fun.rich.client.event.events.impl.player.EventPreMotion;
import fun.rich.client.feature.Feature;
import fun.rich.client.feature.impl.FeatureCategory;
import fun.rich.client.ui.settings.impl.NumberSetting;

public class AutoSoup extends Feature {
    private static final int HOTBAR_SIZE = 9;
    private boolean isActive;
    public static NumberSetting health;
    private int lastSlot = -1;

    public AutoSoup() {
        super("AutoSoup", "Кушает mushroom stew при определенном хп", FeatureCategory.World);
        health = new NumberSetting("Health Amount", 15, 1, 20, 1, () -> true);
        addSettings(health);
    }

    @EventTarget
    public void onUpdate(EventPreMotion eventUpdate) {
        this.setSuffix("" + (int) health.getNumberValue());
        if (mc.player == null || mc.world == null)
            return;

        int stewSlot = findStewInHotbar();
        if (stewSlot == -1) {
            // No stew in hotbar, check inventory
            stewSlot = findStewInInventory();
            if (stewSlot != -1) {
                // Stew found in inventory, move it to hotbar
                moveItemToHotbar(stewSlot);
            }
        }

        ItemStack heldItem = mc.player.getHeldItemMainhand();
        if (heldItem.getItem().isDamageable() && heldItem.getItemDamage() >= heldItem.getMaxDamage() - 5) {
            // The currently held item is almost broken, switch to a new one
            int newSlot = findStewInHotbar();
            if (newSlot != -1) {
                switchToSlot(newSlot);
            }
        }

        if (mc.player.getHealth() <= health.getNumberValue()) {
            isActive = true;
            if (mc.player.getHeldItem(EnumHand.MAIN_HAND).getItem() == Items.MUSHROOM_STEW) {
                mc.rightClickMouse();
            } else if (stewSlot != -1) {
                switchToSlot(stewSlot);
            }
        } else if (isActive) {
            mc.playerController.onStoppedUsingItem(mc.player); // Stop using the current item
            isActive = false;
            if (lastSlot != -1) {
                switchToSlot(lastSlot);
                lastSlot = -1;
            }
        }
    }

    private int findStewInHotbar() {
        for (int i = 0; i < HOTBAR_SIZE; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == Items.MUSHROOM_STEW) {
                return i;
            }
        }
        return -1;
    }

    private int findStewInInventory() {
        for (int i = HOTBAR_SIZE; i < mc.player.inventory.getSizeInventory(); i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == Items.MUSHROOM_STEW) {
                return i;
            }
        }
        return -1;
    }

    private void moveItemToHotbar(int slot) {
        if (slot < HOTBAR_SIZE) {
            return;
        }
        int firstEmptyIndex = findFirstEmptyHotbarSlot();
        if (firstEmptyIndex == -1) {
            return;
        }

        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, firstEmptyIndex, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
    }

    private int findFirstEmptyHotbarSlot() {
        for (int i = 0; i < HOTBAR_SIZE; i++) {
            if (mc.player.inventory.getStackInSlot(i).isEmpty()) {
                return i;
            }
        }
        return -1;
    }

    private void switchSlots(int slot1, int slot2) {
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot1, 0, ClickType.PICKUP,
                mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot2, 0, ClickType.PICKUP,
                mc.player);
    }

    private void switchToSlot(int slot) {
        if (lastSlot == -1 && mc.player.inventory.currentItem != slot) {
            lastSlot = mc.player.inventory.currentItem;
        }
        mc.player.inventory.currentItem = slot;
    }
}
Прикольно
 
read only ambassador
Пользователь
Статус
Оффлайн
Регистрация
28 Июн 2022
Сообщения
628
Реакции[?]
105
Поинты[?]
9K
Написал автосуп с рефиллом в свою пасту рича (рефилл может не обходить античиты, например intave или работать криво), bowl не выкидывает, та и пофиг. Кушает суп от 1 до 20 хп. Создал ещё новую категорию в feature - world. Ну лан юзайте, ес чо пишите, подскажу.

Java:
package fun.rich.client.feature.impl.world;

import net.minecraft.init.Items;
import net.minecraft.inventory.ClickType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;

import fun.rich.client.event.EventTarget;
import fun.rich.client.event.events.impl.player.EventPreMotion;
import fun.rich.client.feature.Feature;
import fun.rich.client.feature.impl.FeatureCategory;
import fun.rich.client.ui.settings.impl.NumberSetting;

public class AutoSoup extends Feature {
    private static final int HOTBAR_SIZE = 9;
    private boolean isActive;
    public static NumberSetting health;
    private int lastSlot = -1;

    public AutoSoup() {
        super("AutoSoup", "Кушает mushroom stew при определенном хп", FeatureCategory.World);
        health = new NumberSetting("Health Amount", 15, 1, 20, 1, () -> true);
        addSettings(health);
    }

    @EventTarget
    public void onUpdate(EventPreMotion eventUpdate) {
        this.setSuffix("" + (int) health.getNumberValue());
        if (mc.player == null || mc.world == null)
            return;

        int stewSlot = findStewInHotbar();
        if (stewSlot == -1) {
            // No stew in hotbar, check inventory
            stewSlot = findStewInInventory();
            if (stewSlot != -1) {
                // Stew found in inventory, move it to hotbar
                moveItemToHotbar(stewSlot);
            }
        }

        ItemStack heldItem = mc.player.getHeldItemMainhand();
        if (heldItem.getItem().isDamageable() && heldItem.getItemDamage() >= heldItem.getMaxDamage() - 5) {
            // The currently held item is almost broken, switch to a new one
            int newSlot = findStewInHotbar();
            if (newSlot != -1) {
                switchToSlot(newSlot);
            }
        }

        if (mc.player.getHealth() <= health.getNumberValue()) {
            isActive = true;
            if (mc.player.getHeldItem(EnumHand.MAIN_HAND).getItem() == Items.MUSHROOM_STEW) {
                mc.rightClickMouse();
            } else if (stewSlot != -1) {
                switchToSlot(stewSlot);
            }
        } else if (isActive) {
            mc.playerController.onStoppedUsingItem(mc.player); // Stop using the current item
            isActive = false;
            if (lastSlot != -1) {
                switchToSlot(lastSlot);
                lastSlot = -1;
            }
        }
    }

    private int findStewInHotbar() {
        for (int i = 0; i < HOTBAR_SIZE; i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == Items.MUSHROOM_STEW) {
                return i;
            }
        }
        return -1;
    }

    private int findStewInInventory() {
        for (int i = HOTBAR_SIZE; i < mc.player.inventory.getSizeInventory(); i++) {
            ItemStack stack = mc.player.inventory.getStackInSlot(i);
            if (stack.getItem() == Items.MUSHROOM_STEW) {
                return i;
            }
        }
        return -1;
    }

    private void moveItemToHotbar(int slot) {
        if (slot < HOTBAR_SIZE) {
            return;
        }
        int firstEmptyIndex = findFirstEmptyHotbarSlot();
        if (firstEmptyIndex == -1) {
            return;
        }

        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, firstEmptyIndex, 0, ClickType.PICKUP, mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot, 0, ClickType.PICKUP, mc.player);
    }

    private int findFirstEmptyHotbarSlot() {
        for (int i = 0; i < HOTBAR_SIZE; i++) {
            if (mc.player.inventory.getStackInSlot(i).isEmpty()) {
                return i;
            }
        }
        return -1;
    }

    private void switchSlots(int slot1, int slot2) {
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot1, 0, ClickType.PICKUP,
                mc.player);
        mc.playerController.windowClick(mc.player.inventoryContainer.windowId, slot2, 0, ClickType.PICKUP,
                mc.player);
    }

    private void switchToSlot(int slot) {
        if (lastSlot == -1 && mc.player.inventory.currentItem != slot) {
            lastSlot = mc.player.inventory.currentItem;
        }
        mc.player.inventory.currentItem = slot;
    }
}
1688589654015.png
 
Сверху Снизу