Исходник ElytraTarget MCP 1.20.1

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

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

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

Спасибо!

Код:
package Fecurity.mods.modules.movement;

import Fecurity.mods.helpers.enums.Category;
import Fecurity.mods.helpers.factories.AbstractModule;
import Fecurity.mods.helpers.support.ModuleTarget;
import Fecurity.systems.event.EventHandler;
import Fecurity.systems.event.events.impl.MoveEvent;
import Fecurity.util.InventoryUtil;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.protocol.game.ServerboundSetCarriedItemPacket;
import net.minecraft.network.protocol.game.ServerboundUseItemPacket;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.AABB;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@ModuleTarget(name = "ElytraTarget", category = Category.MOVEMENT)
public class ElytraTarget extends AbstractModule {

    Set<Player> targetedPlayers = new HashSet<>();
    boolean isTargeting = false;
    long lastFireworkTime = 0L;
    long fireworkCooldown = 750L;
    long lastChatMessageTime = 0L;
    long chatMessageInterval = 5000L;

    @EventHandler
    private void onMoveEvent(MoveEvent moveEvent) {
        this.onUpdate();
    }

    private void onUpdate() {
        if (this.isEnabled()) {
            if (mc.player != null && mc.player.isFallFlying()) {
                if (!isTargeting) {
                    targetPlayer();
                } else {
                    updateRotationToTarget();
                    useFirework();
                    checkChatMessage();
                }
            } else if (isTargeting) {
                stopTargeting();
            }
        } else if (isTargeting) {
            stopTargeting();
        }
    }

    private void targetPlayer() {
        if (mc.level == null || mc.player == null) return;

        double range = 10.0;
        AABB searchBox = new AABB(
                mc.player.getX() - range, mc.player.getY() - 5.0, mc.player.getZ() - range,
                mc.player.getX() + range, mc.player.getY() + 5.0, mc.player.getZ() + range
        );
        List<Entity> entities = mc.level.getEntities(mc.player, searchBox);

        for (Entity entity : entities) {
            if (entity instanceof Player target && target.isAlive() && !target.equals(mc.player)) {
                targetedPlayers.clear();
                targetedPlayers.add(target);
                isTargeting = true;
                setRotationToPlayer(target);
                return;
            }
        }
    }

    private void setRotationToPlayer(Player player) {
        double deltaX = player.getX() - mc.player.getX();
        double deltaY = player.getY() - (mc.player.getY() + mc.player.getEyeHeight());
        double deltaZ = player.getZ() - mc.player.getZ();
        double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);

        float yaw = (float) (Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0);
        float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));

        mc.player.setYRot(yaw);
        mc.player.setXRot(pitch);
    }

    private void updateRotationToTarget() {
        if (!targetedPlayers.isEmpty()) {
            Player target = targetedPlayers.iterator().next();
            setRotationToPlayer(target);
        }
    }

    private void useFirework() {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastFireworkTime >= fireworkCooldown) {

            int fireWorksSlot = InventoryUtil.getFireWorks();
            if (fireWorksSlot == -1) {
                return;
            }

            LocalPlayer player = mc.player;
            if (player == null) return;

            player.connection.send(new ServerboundSetCarriedItemPacket(fireWorksSlot));

            player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 0));

            player.connection.send(new ServerboundSetCarriedItemPacket(player.getInventory().selected));
            lastFireworkTime = currentTime;
        }
    }


    private void stopTargeting() {
        targetedPlayers.clear();
        isTargeting = false;
    }

    private void checkChatMessage() {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastChatMessageTime >= chatMessageInterval) {
            if (!targetedPlayers.isEmpty()) {
                Player target = targetedPlayers.iterator().next();
                if (target.getHealth() <= 0.01F) {
                    targetedPlayers.clear();
                    this.toggle();
                }
            }
            lastChatMessageTime = currentTime;
        }

        if (mc.player.getHealth() < 6.0F) {
            stopTargeting();
            this.toggle();
        }
    }
}
 
Начинающий
Статус
Оффлайн
Регистрация
10 Июл 2023
Сообщения
200
Реакции[?]
2
Поинты[?]
1K
Код:
package Fecurity.mods.modules.movement;

import Fecurity.mods.helpers.enums.Category;
import Fecurity.mods.helpers.factories.AbstractModule;
import Fecurity.mods.helpers.support.ModuleTarget;
import Fecurity.systems.event.EventHandler;
import Fecurity.systems.event.events.impl.MoveEvent;
import Fecurity.util.InventoryUtil;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.protocol.game.ServerboundSetCarriedItemPacket;
import net.minecraft.network.protocol.game.ServerboundUseItemPacket;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.AABB;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@ModuleTarget(name = "ElytraTarget", category = Category.MOVEMENT)
public class ElytraTarget extends AbstractModule {

    Set<Player> targetedPlayers = new HashSet<>();
    boolean isTargeting = false;
    long lastFireworkTime = 0L;
    long fireworkCooldown = 750L;
    long lastChatMessageTime = 0L;
    long chatMessageInterval = 5000L;

    @EventHandler
    private void onMoveEvent(MoveEvent moveEvent) {
        this.onUpdate();
    }

    private void onUpdate() {
        if (this.isEnabled()) {
            if (mc.player != null && mc.player.isFallFlying()) {
                if (!isTargeting) {
                    targetPlayer();
                } else {
                    updateRotationToTarget();
                    useFirework();
                    checkChatMessage();
                }
            } else if (isTargeting) {
                stopTargeting();
            }
        } else if (isTargeting) {
            stopTargeting();
        }
    }

    private void targetPlayer() {
        if (mc.level == null || mc.player == null) return;

        double range = 10.0;
        AABB searchBox = new AABB(
                mc.player.getX() - range, mc.player.getY() - 5.0, mc.player.getZ() - range,
                mc.player.getX() + range, mc.player.getY() + 5.0, mc.player.getZ() + range
        );
        List<Entity> entities = mc.level.getEntities(mc.player, searchBox);

        for (Entity entity : entities) {
            if (entity instanceof Player target && target.isAlive() && !target.equals(mc.player)) {
                targetedPlayers.clear();
                targetedPlayers.add(target);
                isTargeting = true;
                setRotationToPlayer(target);
                return;
            }
        }
    }

    private void setRotationToPlayer(Player player) {
        double deltaX = player.getX() - mc.player.getX();
        double deltaY = player.getY() - (mc.player.getY() + mc.player.getEyeHeight());
        double deltaZ = player.getZ() - mc.player.getZ();
        double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);

        float yaw = (float) (Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0);
        float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));

        mc.player.setYRot(yaw);
        mc.player.setXRot(pitch);
    }

    private void updateRotationToTarget() {
        if (!targetedPlayers.isEmpty()) {
            Player target = targetedPlayers.iterator().next();
            setRotationToPlayer(target);
        }
    }

    private void useFirework() {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastFireworkTime >= fireworkCooldown) {

            int fireWorksSlot = InventoryUtil.getFireWorks();
            if (fireWorksSlot == -1) {
                return;
            }

            LocalPlayer player = mc.player;
            if (player == null) return;

            player.connection.send(new ServerboundSetCarriedItemPacket(fireWorksSlot));

            player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 0));

            player.connection.send(new ServerboundSetCarriedItemPacket(player.getInventory().selected));
            lastFireworkTime = currentTime;
        }
    }


    private void stopTargeting() {
        targetedPlayers.clear();
        isTargeting = false;
    }

    private void checkChatMessage() {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastChatMessageTime >= chatMessageInterval) {
            if (!targetedPlayers.isEmpty()) {
                Player target = targetedPlayers.iterator().next();
                if (target.getHealth() <= 0.01F) {
                    targetedPlayers.clear();
                    this.toggle();
                }
            }
            lastChatMessageTime = currentTime;
        }

        if (mc.player.getHealth() < 6.0F) {
            stopTargeting();
            this.toggle();
        }
    }
}
ЪуЪ
 
Начинающий
Статус
Оффлайн
Регистрация
20 Июн 2024
Сообщения
261
Реакции[?]
1
Поинты[?]
1K
Код:
package Fecurity.mods.modules.movement;

import Fecurity.mods.helpers.enums.Category;
import Fecurity.mods.helpers.factories.AbstractModule;
import Fecurity.mods.helpers.support.ModuleTarget;
import Fecurity.systems.event.EventHandler;
import Fecurity.systems.event.events.impl.MoveEvent;
import Fecurity.util.InventoryUtil;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.network.protocol.game.ServerboundSetCarriedItemPacket;
import net.minecraft.network.protocol.game.ServerboundUseItemPacket;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.AABB;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@ModuleTarget(name = "ElytraTarget", category = Category.MOVEMENT)
public class ElytraTarget extends AbstractModule {

    Set<Player> targetedPlayers = new HashSet<>();
    boolean isTargeting = false;
    long lastFireworkTime = 0L;
    long fireworkCooldown = 750L;
    long lastChatMessageTime = 0L;
    long chatMessageInterval = 5000L;

    @EventHandler
    private void onMoveEvent(MoveEvent moveEvent) {
        this.onUpdate();
    }

    private void onUpdate() {
        if (this.isEnabled()) {
            if (mc.player != null && mc.player.isFallFlying()) {
                if (!isTargeting) {
                    targetPlayer();
                } else {
                    updateRotationToTarget();
                    useFirework();
                    checkChatMessage();
                }
            } else if (isTargeting) {
                stopTargeting();
            }
        } else if (isTargeting) {
            stopTargeting();
        }
    }

    private void targetPlayer() {
        if (mc.level == null || mc.player == null) return;

        double range = 10.0;
        AABB searchBox = new AABB(
                mc.player.getX() - range, mc.player.getY() - 5.0, mc.player.getZ() - range,
                mc.player.getX() + range, mc.player.getY() + 5.0, mc.player.getZ() + range
        );
        List<Entity> entities = mc.level.getEntities(mc.player, searchBox);

        for (Entity entity : entities) {
            if (entity instanceof Player target && target.isAlive() && !target.equals(mc.player)) {
                targetedPlayers.clear();
                targetedPlayers.add(target);
                isTargeting = true;
                setRotationToPlayer(target);
                return;
            }
        }
    }

    private void setRotationToPlayer(Player player) {
        double deltaX = player.getX() - mc.player.getX();
        double deltaY = player.getY() - (mc.player.getY() + mc.player.getEyeHeight());
        double deltaZ = player.getZ() - mc.player.getZ();
        double distanceXZ = Math.sqrt(deltaX * deltaX + deltaZ * deltaZ);

        float yaw = (float) (Math.toDegrees(Math.atan2(deltaZ, deltaX)) - 90.0);
        float pitch = (float) -Math.toDegrees(Math.atan2(deltaY, distanceXZ));

        mc.player.setYRot(yaw);
        mc.player.setXRot(pitch);
    }

    private void updateRotationToTarget() {
        if (!targetedPlayers.isEmpty()) {
            Player target = targetedPlayers.iterator().next();
            setRotationToPlayer(target);
        }
    }

    private void useFirework() {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastFireworkTime >= fireworkCooldown) {

            int fireWorksSlot = InventoryUtil.getFireWorks();
            if (fireWorksSlot == -1) {
                return;
            }

            LocalPlayer player = mc.player;
            if (player == null) return;

            player.connection.send(new ServerboundSetCarriedItemPacket(fireWorksSlot));

            player.connection.send(new ServerboundUseItemPacket(InteractionHand.MAIN_HAND, 0));

            player.connection.send(new ServerboundSetCarriedItemPacket(player.getInventory().selected));
            lastFireworkTime = currentTime;
        }
    }


    private void stopTargeting() {
        targetedPlayers.clear();
        isTargeting = false;
    }

    private void checkChatMessage() {
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastChatMessageTime >= chatMessageInterval) {
            if (!targetedPlayers.isEmpty()) {
                Player target = targetedPlayers.iterator().next();
                if (target.getHealth() <= 0.01F) {
                    targetedPlayers.clear();
                    this.toggle();
                }
            }
            lastChatMessageTime = currentTime;
        }

        if (mc.player.getHealth() < 6.0F) {
            stopTargeting();
            this.toggle();
        }
    }
}
wtf.chatgpt.client.modules.movement
 
Сверху Снизу