Начинающий
- Статус
- Оффлайн
- Регистрация
- 15 Янв 2026
- Сообщения
- 8
- Реакции
- 0
- Выберите загрузчик игры
- Fabric
Что-то по типу AutoWarden для фт, но для медного данжа, незнаю зачем, но типы какие-то хотели это.
Как работает:
Лутает из сундука с табличкой инвизку, тепается на /home, там лутает бочки и ломает вазы, после того как слутал что-то он тепается на /darena, потом на /clan home storage, выкладывается и все повторяется заново. Настройки лута нету, лутает все чё найдет.
Как работает:
Лутает из сундука с табличкой инвизку, тепается на /home, там лутает бочки и ломает вазы, после того как слутал что-то он тепается на /darena, потом на /clan home storage, выкладывается и все повторяется заново. Настройки лута нету, лутает все чё найдет.
autodange:
package baritone.helper;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.ChestBlockEntity;
import net.minecraft.block.entity.SignBlockEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.item.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ChestScreenHandler;
import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import java.util.ArrayList;
import java.util.List;
public class AutoLooter implements ClientModInitializer {
private static final MinecraftClient mc = MinecraftClient.getInstance();
private enum State { GET_INVIS, WAIT_HOME, LOOTING, USE_DARENA, WAIT_DARENA, CLAN_HOME, WAIT_CLAN_STORAGE, DEPOSIT }
private State currentState = State.GET_INVIS;
private int timer = 0;
private boolean running = true;
private BlockPos targetChest = null;
private List<BlockPos> barrels = new ArrayList<>();
private int noLootCounter = 0;
@Override
public void onInitializeClient() {
ClientTickEvents.END_CLIENT_TICK.register(client -> {
if (mc.player == null || mc.world == null || !running) return;
switch (currentState) {
case GET_INVIS -> getInvisibilityPotions();
case WAIT_HOME -> {
timer--;
if (timer <= 0) {
mc.player.sendChatMessage("/home");
currentState = State.LOOTING;
}
}
case LOOTING -> lootEverything();
case USE_DARENA -> {
mc.player.sendChatMessage("/darena");
currentState = State.WAIT_DARENA;
timer = 20;
}
case WAIT_DARENA -> {
timer--;
if (timer <= 0) {
clickPufferfish();
currentState = State.CLAN_HOME;
timer = 60;
}
}
case CLAN_HOME -> {
timer--;
if (timer <= 0) {
mc.player.sendChatMessage("/clan home storage");
currentState = State.WAIT_CLAN_STORAGE;
timer = 160;
}
}
case WAIT_CLAN_STORAGE -> {
timer--;
if (timer <= 0) {
timer = 30;
currentState = State.DEPOSIT;
}
}
case DEPOSIT -> depositAllItems();
}
});
}
private void getInvisibilityPotions() {
if (targetChest == null) {
for (BlockEntity entity : mc.world.blockEntities) {
if (entity instanceof ChestBlockEntity chest) {
BlockPos pos = chest.getPos();
for (BlockEntity signEntity : mc.world.blockEntities) {
if (signEntity instanceof SignBlockEntity sign && sign.getPos().equals(pos.up())) {
String text = sign.getTextOnRow(0, false).getString().toLowerCase();
if (text.contains("inv") || text.contains("инвиз")) {
targetChest = pos;
break;
}
}
}
}
}
}
if (targetChest != null && mc.player.currentScreenHandler instanceof ChestScreenHandler chest) {
for (int i = 0; i < chest.getInventory().size(); i++) {
ItemStack stack = chest.getInventory().getStack(i);
if (!stack.isEmpty() && (stack.getItem() == Items.POTION || stack.getItem() == Items.SPLASH_POTION)) {
if (stack.getName().getString().toLowerCase().contains("invis") ||
stack.getName().getString().toLowerCase().contains("невидимости")) {
mc.interactionManager.clickSlot(chest.syncId, i, 0, SlotActionType.QUICK_MOVE, mc.player);
currentState = State.WAIT_HOME;
timer = 160;
return;
}
}
}
if (isInventoryFull()) running = false;
} else if (targetChest != null) {
Vec3d hitVec = new Vec3d(targetChest.getX() + 0.5, targetChest.getY() + 0.5, targetChest.getZ() + 0.5);
BlockHitResult hit = new BlockHitResult(hitVec, Direction.UP, targetChest, false);
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, hit);
} else {
running = false;
}
}
private void lootEverything() {
boolean looted = false;
barrels.clear();
for (BlockEntity entity : mc.world.blockEntities) {
if (entity instanceof ChestBlockEntity && !entity.getPos().equals(targetChest)) {
if (lootChestAt(entity.getPos())) looted = true;
}
}
if (!looted) {
for (BlockPos pos : findVases()) {
if (breakVase(pos)) looted = true;
}
}
if (looted) {
currentState = State.USE_DARENA;
noLootCounter = 0;
} else {
noLootCounter++;
if (noLootCounter > 5) running = false;
}
}
private boolean lootChestAt(BlockPos pos) {
if (mc.player.squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ()) > 625) return false;
Vec3d hitVec = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
BlockHitResult hit = new BlockHitResult(hitVec, Direction.UP, pos, false);
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, hit);
if (mc.player.currentScreenHandler instanceof ChestScreenHandler chest) {
for (int i = 0; i < chest.getInventory().size(); i++) {
ItemStack stack = chest.getInventory().getStack(i);
if (!stack.isEmpty()) {
mc.interactionManager.clickSlot(chest.syncId, i, 0, SlotActionType.QUICK_MOVE, mc.player);
}
}
mc.player.closeHandledScreen();
return true;
}
return false;
}
private List<BlockPos> findVases() {
List<BlockPos> vasePoses = new ArrayList<>();
BlockPos playerPos = mc.player.getBlockPos();
for (int x = -10; x <= 10; x++) {
for (int z = -10; z <= 10; z++) {
for (int y = -5; y <= 5; y++) {
BlockPos pos = playerPos.add(x, y, z);
if (mc.world.getBlockState(pos).getBlock() == Blocks.FLOWER_POT) {
vasePoses.add(pos);
}
}
}
}
return vasePoses;
}
private boolean breakVase(BlockPos pos) {
if (mc.player.squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ()) > 100) return false;
mc.interactionManager.attackBlock(pos, mc.player);
mc.player.swingHand(Hand.MAIN_HAND);
return true;
}
private void clickPufferfish() {
if (mc.player.currentScreenHandler instanceof ChestScreenHandler chest) {
for (int i = 0; i < chest.getInventory().size(); i++) {
ItemStack stack = chest.getInventory().getStack(i);
if (!stack.isEmpty() && stack.getItem() ==.Items.PUFFERFISH) {
mc.interactionManager.clickSlot(chest.syncId, i, 0, SlotActionType.PICKUP, mc.player);
mc.interactionManager.clickSlot(chest.syncId, i, 0, SlotActionType.PICKUP, mc.player);
break;
}
}
mc.player.closeHandledScreen();
}
}
private void depositAllItems() {
boolean deposited = false;
for (BlockEntity entity : mc.world.blockEntities) {
if (entity instanceof ChestBlockEntity chest) {
BlockPos pos = chest.getPos();
if (pos.equals(targetChest)) continue;
if (depositToContainer(pos)) deposited = true;
}
}
if (deposited || timer <= 0) {
currentState = State.GET_INVIS;
timer = 0;
}
}
private boolean depositToContainer(BlockPos pos) {
if (mc.player.squaredDistanceTo(pos.getX(), pos.getY(), pos.getZ()) > 100) return false;
Vec3d hitVec = new Vec3d(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
BlockHitResult hit = new BlockHitResult(hitVec, Direction.UP, pos, false);
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, hit);
if (mc.player.currentScreenHandler instanceof ChestScreenHandler chest) {
for (int i = 0; i < chest.getInventory().size(); i++) {
if (chest.getInventory().getStack(i).isEmpty()) {
for (int j = 9; j < 36; j++) {
ItemStack invStack = mc.player.getInventory().getStack(j);
if (!invStack.isEmpty() && !isExcludedItem(invStack)) {
mc.interactionManager.clickSlot(chest.syncId, i, 0, SlotActionType.QUICK_MOVE, mc.player);
break;
}
}
}
}
mc.player.closeHandledScreen();
return true;
}
return false;
}
private boolean isExcludedItem(ItemStack stack) {
return stack.getItem() == Items.POTION ||
(stack.getItem() == Items.SPLASH_POTION &&
stack.getName().getString().toLowerCase().contains("invis"));
}
private boolean isInventoryFull() {
for (int i = 9; i < 36; i++) {
if (mc.player.getInventory().getStack(i).isEmpty()) return false;
}
return true;
}
}