Подписывайтесь на наш Telegram и не пропускайте важные новости! Перейти

Часть функционала AntiBot Expensive 3.1 ReallyWorld

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
23 Июн 2025
Сообщения
43
Реакции
0
Выберите загрузчик игры
  1. Vanilla
Код:
Expand Collapse Copy
package im.expensive.functions.impl.combat;

import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.item.ItemStack;

@FunctionRegister(name = "AntiBot", type = Category.Combat)
public class AntiBot extends Function {
    public static List<Entity> bots = new ArrayList<Entity>();

    public AntiBot() {
        super();
    }

    @Subscribe
    public void onUpdate(EventUpdate eventUpdate) {
        this.reallyWorldCheck();
    }

    private void reallyWorldCheck() {
        for (PlayerEntity playerEntity : mc.world.getPlayers()) {
            if (mc.player == playerEntity) {
                continue;
            }

            boolean armorCheck = false;
            boolean enchantCheck = false;
            boolean armorDamagedCheck = false;
            boolean offHandCheck = playerEntity.getHeldItemOffhand().getItem() == Items.AIR;
            boolean equipCheck =
                    playerEntity.inventory.armorInventory.get(0).getItem() == Items.LEATHER_BOOTS ||
                            playerEntity.inventory.armorInventory.get(0).getItem() == Items.IRON_BOOTS ||
                            playerEntity.inventory.armorInventory.get(1).getItem() == Items.LEATHER_LEGGINGS ||
                            playerEntity.inventory.armorInventory.get(1).getItem() == Items.IRON_LEGGINGS ||
                            playerEntity.inventory.armorInventory.get(2).getItem() == Items.LEATHER_CHESTPLATE ||
                            playerEntity.inventory.armorInventory.get(2).getItem() == Items.IRON_CHESTPLATE ||
                            playerEntity.inventory.armorInventory.get(3).getItem() == Items.LEATHER_HELMET ||
                            playerEntity.inventory.armorInventory.get(3).getItem() == Items.IRON_HELMET;
            boolean mainHandCheck = playerEntity.getHeldItemMainhand().getItem() != Items.AIR;
            boolean foodCheck = playerEntity.getFoodStats().getFoodLevel() == 20;
            
            for (int i = 0; i < 4; ++i) {
                ItemStack armorPiece = playerEntity.inventory.armorInventory.get(i);

                if (!armorCheck && armorPiece.getItem() != Items.AIR) {
                    armorCheck = true;
                }

                if (!enchantCheck && armorPiece.isEnchantable()) {
                    enchantCheck = true;
                }

                if (!armorDamagedCheck && !armorPiece.isDamaged()) {
                    armorDamagedCheck = true;
                }
            }
            
            if (armorCheck && enchantCheck && armorDamagedCheck && offHandCheck &&
                    equipCheck && mainHandCheck && foodCheck) {
                if (!bots.contains(playerEntity)) {
                    bots.add(playerEntity);
                }
            } else {
                bots.remove(playerEntity);
            }
        }
    }
    
    public static boolean isBot(Entity entity) {
        return entity instanceof PlayerEntity && bots.contains(entity);
    }
    
    public static boolean isBot(LivingEntity entity) {
        return entity instanceof PlayerEntity && bots.contains(entity);
    }
    
    public static boolean checkBot(Entity entity) {
        return isBot(entity);
    }

    @Override
    public void onDisable() {
        super.onDisable();
        bots.clear();
    }
}
 
Код:
Expand Collapse Copy
package im.expensive.functions.impl.combat;

import com.google.common.eventbus.Subscribe;
import im.expensive.events.EventUpdate;
import im.expensive.functions.api.Category;
import im.expensive.functions.api.Function;
import im.expensive.functions.api.FunctionRegister;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.item.ItemStack;

@FunctionRegister(name = "AntiBot", type = Category.Combat)
public class AntiBot extends Function {
    public static List<Entity> bots = new ArrayList<Entity>();

    public AntiBot() {
        super();
    }

    @Subscribe
    public void onUpdate(EventUpdate eventUpdate) {
        this.reallyWorldCheck();
    }

    private void reallyWorldCheck() {
        for (PlayerEntity playerEntity : mc.world.getPlayers()) {
            if (mc.player == playerEntity) {
                continue;
            }

            boolean armorCheck = false;
            boolean enchantCheck = false;
            boolean armorDamagedCheck = false;
            boolean offHandCheck = playerEntity.getHeldItemOffhand().getItem() == Items.AIR;
            boolean equipCheck =
                    playerEntity.inventory.armorInventory.get(0).getItem() == Items.LEATHER_BOOTS ||
                            playerEntity.inventory.armorInventory.get(0).getItem() == Items.IRON_BOOTS ||
                            playerEntity.inventory.armorInventory.get(1).getItem() == Items.LEATHER_LEGGINGS ||
                            playerEntity.inventory.armorInventory.get(1).getItem() == Items.IRON_LEGGINGS ||
                            playerEntity.inventory.armorInventory.get(2).getItem() == Items.LEATHER_CHESTPLATE ||
                            playerEntity.inventory.armorInventory.get(2).getItem() == Items.IRON_CHESTPLATE ||
                            playerEntity.inventory.armorInventory.get(3).getItem() == Items.LEATHER_HELMET ||
                            playerEntity.inventory.armorInventory.get(3).getItem() == Items.IRON_HELMET;
            boolean mainHandCheck = playerEntity.getHeldItemMainhand().getItem() != Items.AIR;
            boolean foodCheck = playerEntity.getFoodStats().getFoodLevel() == 20;
           
            for (int i = 0; i < 4; ++i) {
                ItemStack armorPiece = playerEntity.inventory.armorInventory.get(i);

                if (!armorCheck && armorPiece.getItem() != Items.AIR) {
                    armorCheck = true;
                }

                if (!enchantCheck && armorPiece.isEnchantable()) {
                    enchantCheck = true;
                }

                if (!armorDamagedCheck && !armorPiece.isDamaged()) {
                    armorDamagedCheck = true;
                }
            }
           
            if (armorCheck && enchantCheck && armorDamagedCheck && offHandCheck &&
                    equipCheck && mainHandCheck && foodCheck) {
                if (!bots.contains(playerEntity)) {
                    bots.add(playerEntity);
                }
            } else {
                bots.remove(playerEntity);
            }
        }
    }
   
    public static boolean isBot(Entity entity) {
        return entity instanceof PlayerEntity && bots.contains(entity);
    }
   
    public static boolean isBot(LivingEntity entity) {
        return entity instanceof PlayerEntity && bots.contains(entity);
    }
   
    public static boolean checkBot(Entity entity) {
        return isBot(entity);
    }

    @Override
    public void onDisable() {
        super.onDisable();
        bots.clear();
    }
}
так сделать буквально 5 строк
public static UUID getOfflineUUID(String username) {
return UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes(StandardCharsets.UTF_8));
}

boolean uniqueCheckPass = !player.getUuid().equals(getOfflineUUID(player.getName().getString()));
if (!uniqueCheckPass || !botCheckPass) continue;
bots.add(player);


ну чуть чуть больше
 
Назад
Сверху Снизу