Исходник ElytraMotion как в современных софтах zenith 1.21.4

Начинающий
Начинающий
Статус
Оффлайн
Регистрация
18 Май 2025
Сообщения
52
Реакции
1
Выберите загрузчик игры
  1. Vanilla
  2. Fabric
Код:
Expand Collapse Copy
package pl.PolskiDLC.implement.features.modules.movement;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import pl.PolskiDLC.api.event.EventHandler;
import pl.PolskiDLC.api.feature.module.Module;
import pl.PolskiDLC.api.feature.module.ModuleCategory;
import pl.PolskiDLC.common.util.entity.PlayerInventoryUtil;
import pl.PolskiDLC.implement.events.player.TickEvent;

@FieldDefaults(level = AccessLevel.PRIVATE)
public class ElytraMotion extends Module {
    boolean lastTick = false;
    int fireworkTick;

    public ElytraMotion() {
        super("ElytraMotion", "Elytra Motion", ModuleCategory.MOVEMENT);
    }

    @EventHandler
    public void onTick(TickEvent e) {
        int lastSlot = mc.player.getInventory().selectedSlot;
        if (mc.player.getInventory().getStack(38).getItem() == Items.ELYTRA && mc.player.isGliding() && mc.options.forwardKey.isPressed()) {
            if (PlayerInventoryUtil.boolHotbarItem(Items.FIREWORK_ROCKET)) {
                int fireworkSlot = PlayerInventoryUtil.searchHotbarItem(Items.FIREWORK_ROCKET);
                if (fireworkTick >= 10) {
                    lastTick = true;
                    mc.player.getInventory().selectedSlot = fireworkSlot;
                    mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND);
                    mc.player.getInventory().selectedSlot = lastSlot;
                    fireworkTick = 0;
                } else fireworkTick++;
                if (lastTick) {
                    mc.player.setVelocity(0, 0, 0);
                }
            }
        } else {
            fireworkTick = 10;
        }
    }

    public void deactivate() {
        fireworkTick = 10;
    }
}

чтоб остановить мотион надо держать кнопку вперёд
увидел в новых читах под рв эту функцию и решил её сделать


Пожалуйста, авторизуйтесь для просмотра ссылки.
 
1760964788527.png

спасиб, я спастил
 
Код:
Expand Collapse Copy
package pl.PolskiDLC.implement.features.modules.movement;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import pl.PolskiDLC.api.event.EventHandler;
import pl.PolskiDLC.api.feature.module.Module;
import pl.PolskiDLC.api.feature.module.ModuleCategory;
import pl.PolskiDLC.common.util.entity.PlayerInventoryUtil;
import pl.PolskiDLC.implement.events.player.TickEvent;

@FieldDefaults(level = AccessLevel.PRIVATE)
public class ElytraMotion extends Module {
    boolean lastTick = false;
    int fireworkTick;

    public ElytraMotion() {
        super("ElytraMotion", "Elytra Motion", ModuleCategory.MOVEMENT);
    }

    @EventHandler
    public void onTick(TickEvent e) {
        int lastSlot = mc.player.getInventory().selectedSlot;
        if (mc.player.getInventory().getStack(38).getItem() == Items.ELYTRA && mc.player.isGliding() && mc.options.forwardKey.isPressed()) {
            if (PlayerInventoryUtil.boolHotbarItem(Items.FIREWORK_ROCKET)) {
                int fireworkSlot = PlayerInventoryUtil.searchHotbarItem(Items.FIREWORK_ROCKET);
                if (fireworkTick >= 10) {
                    lastTick = true;
                    mc.player.getInventory().selectedSlot = fireworkSlot;
                    mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND);
                    mc.player.getInventory().selectedSlot = lastSlot;
                    fireworkTick = 0;
                } else fireworkTick++;
                if (lastTick) {
                    mc.player.setVelocity(0, 0, 0);
                }
            }
        } else {
            fireworkTick = 10;
        }
    }

    public void deactivate() {
        fireworkTick = 10;
    }
}

чтоб остановить мотион надо держать кнопку вперёд
увидел в новых читах под рв эту функцию и решил её сделать


Пожалуйста, авторизуйтесь для просмотра ссылки.
1760969070675.png
можешь кинуть эти методы?
 
Код:
Expand Collapse Copy
package pl.PolskiDLC.implement.features.modules.movement;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import pl.PolskiDLC.api.event.EventHandler;
import pl.PolskiDLC.api.feature.module.Module;
import pl.PolskiDLC.api.feature.module.ModuleCategory;
import pl.PolskiDLC.common.util.entity.PlayerInventoryUtil;
import pl.PolskiDLC.implement.events.player.TickEvent;

@FieldDefaults(level = AccessLevel.PRIVATE)
public class ElytraMotion extends Module {
    boolean lastTick = false;
    int fireworkTick;

    public ElytraMotion() {
        super("ElytraMotion", "Elytra Motion", ModuleCategory.MOVEMENT);
    }

    @EventHandler
    public void onTick(TickEvent e) {
        int lastSlot = mc.player.getInventory().selectedSlot;
        if (mc.player.getInventory().getStack(38).getItem() == Items.ELYTRA && mc.player.isGliding() && mc.options.forwardKey.isPressed()) {
            if (PlayerInventoryUtil.boolHotbarItem(Items.FIREWORK_ROCKET)) {
                int fireworkSlot = PlayerInventoryUtil.searchHotbarItem(Items.FIREWORK_ROCKET);
                if (fireworkTick >= 10) {
                    lastTick = true;
                    mc.player.getInventory().selectedSlot = fireworkSlot;
                    mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND);
                    mc.player.getInventory().selectedSlot = lastSlot;
                    fireworkTick = 0;
                } else fireworkTick++;
                if (lastTick) {
                    mc.player.setVelocity(0, 0, 0);
                }
            }
        } else {
            fireworkTick = 10;
        }
    }

    public void deactivate() {
        fireworkTick = 10;
    }
}

чтоб остановить мотион надо держать кнопку вперёд
увидел в новых читах под рв эту функцию и решил её сделать


Пожалуйста, авторизуйтесь для просмотра ссылки.
не проще сделать через дистанцию килки остановку?
 
public static int searchHotbarItem(Item item) {
for (int i=0; i < 9; i++) {
if (mc.player.getInventory().getStack(i).getItem() == item) {
return i;
}
}
return -1;
}

public static boolean boolHotbarItem(Item item) {
for (int i=0; i < 9; i++) {
if (mc.player.getInventory().getStack(i).getItem() == item) {
return true;
}
}
return false;
}
 
мега домер обход:
Expand Collapse Copy
package zenith.zov.client.modules.impl.movement;

import com.darkmagician6.eventapi.EventTarget;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.Vec3d;
import zenith.zov.base.events.impl.player.EventMove;
import zenith.zov.base.events.impl.player.EventUpdate;
import zenith.zov.client.modules.api.Category;
import zenith.zov.client.modules.api.Module;
import zenith.zov.client.modules.api.ModuleAnnotation;
import zenith.zov.client.modules.api.setting.impl.NumberSetting;
import zenith.zov.client.modules.impl.combat.Aura;

/**
 * Пошел японца на автототем чекать
 * @author ultra_lox
 * @since 12.10.2025
 */

@ModuleAnnotation(name = "ElytraMotion", category = Category.MOVEMENT, description = "Дополнение к элитра-таргету: фриз при достижении цели")
public final class ElytraMotion extends Module {
    public static final ElytraMotion INSTANCE = new ElytraMotion();
    private final NumberSetting attackDistance = new NumberSetting("Дистанция", 3.0f, 0.1f, 5.0f, 0.01f);
    private boolean freeze;

    private ElytraMotion() {
        super();
    }

    @EventTarget
    public void onUpdate(EventUpdate e) {
        if (mc.player == null) return;
        if (!mc.player.isGliding()) {
            freeze = false;
            return;
        }
        Aura aura = Aura.INSTANCE;
        if (shouldFreeze(aura)) {
            mc.options.forwardKey.setPressed(false);
            freeze = true;
        } else {
            mc.options.forwardKey.setPressed(true);
            freeze = false;
        }
    }

    @EventTarget
    private void onMove(EventMove event) {
        if (!freeze || mc.player == null) return;
        event.setMovePos(Vec3d.ZERO);
        mc.player.setVelocity(Vec3d.ZERO);
    }

    private boolean shouldFreeze(Aura aura) {
        if (aura == null || !aura.isEnabled()) return false;
        LivingEntity target = aura.getTarget();
        if (target == null) return false;
        return mc.player.isGliding() && mc.player.squaredDistanceTo(target) < (double) (attackDistance.getCurrent() * attackDistance.getCurrent());
    }

    @Override
    public void onDisable() {
        freeze = false;
        if (mc.player != null) {
            mc.options.forwardKey.setPressed(
                    mc.getWindow() != null && mc.getWindow().getHandle() != 0 &&
                            org.lwjgl.glfw.GLFW.glfwGetKey(mc.getWindow().getHandle(), mc.options.forwardKey.getDefaultKey().getCode()) == org.lwjgl.glfw.GLFW.GLFW_PRESS
            );
        }
        super.onDisable();
    }
}
фу какашка, я под рекод лучше сделал
 
мега домер обход:
Expand Collapse Copy
package zenith.zov.client.modules.impl.movement;

import com.darkmagician6.eventapi.EventTarget;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.math.Vec3d;
import zenith.zov.base.events.impl.player.EventMove;
import zenith.zov.base.events.impl.player.EventUpdate;
import zenith.zov.client.modules.api.Category;
import zenith.zov.client.modules.api.Module;
import zenith.zov.client.modules.api.ModuleAnnotation;
import zenith.zov.client.modules.api.setting.impl.NumberSetting;
import zenith.zov.client.modules.impl.combat.Aura;

/**
 * Пошел японца на автототем чекать
 * @author ultra_lox
 * @since 12.10.2025
 */

@ModuleAnnotation(name = "ElytraMotion", category = Category.MOVEMENT, description = "Дополнение к элитра-таргету: фриз при достижении цели")
public final class ElytraMotion extends Module {
    public static final ElytraMotion INSTANCE = new ElytraMotion();
    private final NumberSetting attackDistance = new NumberSetting("Дистанция", 3.0f, 0.1f, 5.0f, 0.01f);
    private boolean freeze;

    private ElytraMotion() {
        super();
    }

    @EventTarget
    public void onUpdate(EventUpdate e) {
        if (mc.player == null) return;
        if (!mc.player.isGliding()) {
            freeze = false;
            return;
        }
        Aura aura = Aura.INSTANCE;
        if (shouldFreeze(aura)) {
            mc.options.forwardKey.setPressed(false);
            freeze = true;
        } else {
            mc.options.forwardKey.setPressed(true);
            freeze = false;
        }
    }

    @EventTarget
    private void onMove(EventMove event) {
        if (!freeze || mc.player == null) return;
        event.setMovePos(Vec3d.ZERO);
        mc.player.setVelocity(Vec3d.ZERO);
    }

    private boolean shouldFreeze(Aura aura) {
        if (aura == null || !aura.isEnabled()) return false;
        LivingEntity target = aura.getTarget();
        if (target == null) return false;
        return mc.player.isGliding() && mc.player.squaredDistanceTo(target) < (double) (attackDistance.getCurrent() * attackDistance.getCurrent());
    }

    @Override
    public void onDisable() {
        freeze = false;
        if (mc.player != null) {
            mc.options.forwardKey.setPressed(
                    mc.getWindow() != null && mc.getWindow().getHandle() != 0 &&
                            org.lwjgl.glfw.GLFW.glfwGetKey(mc.getWindow().getHandle(), mc.options.forwardKey.getDefaultKey().getCode()) == org.lwjgl.glfw.GLFW.GLFW_PRESS
            );
        }
        super.onDisable();
    }
}
фу какашка, я под рекод лучше сделал
молодец, а мне что с этого?
 
ее в килке зенита нету, дистанцию ты настроить не сможешь
public static int searchHotbarItem(Item item) {
for (int i=0; i < 9; i++) {
if (mc.player.getInventory().getStack(i).getItem() == item) {
return i;
}
}
return -1;
}

public static boolean boolHotbarItem(Item item) {
for (int i=0; i < 9; i++) {
if (mc.player.getInventory().getStack(i).getItem() == item) {
return true;
}
}
return false;
}
1760972524318.png

мне чат гпт такое выдал. по факту - такое же
 
Код:
Expand Collapse Copy
package pl.PolskiDLC.implement.features.modules.movement;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import pl.PolskiDLC.api.event.EventHandler;
import pl.PolskiDLC.api.feature.module.Module;
import pl.PolskiDLC.api.feature.module.ModuleCategory;
import pl.PolskiDLC.common.util.entity.PlayerInventoryUtil;
import pl.PolskiDLC.implement.events.player.TickEvent;

@FieldDefaults(level = AccessLevel.PRIVATE)
public class ElytraMotion extends Module {
    boolean lastTick = false;
    int fireworkTick;

    public ElytraMotion() {
        super("ElytraMotion", "Elytra Motion", ModuleCategory.MOVEMENT);
    }

    @EventHandler
    public void onTick(TickEvent e) {
        int lastSlot = mc.player.getInventory().selectedSlot;
        if (mc.player.getInventory().getStack(38).getItem() == Items.ELYTRA && mc.player.isGliding() && mc.options.forwardKey.isPressed()) {
            if (PlayerInventoryUtil.boolHotbarItem(Items.FIREWORK_ROCKET)) {
                int fireworkSlot = PlayerInventoryUtil.searchHotbarItem(Items.FIREWORK_ROCKET);
                if (fireworkTick >= 10) {
                    lastTick = true;
                    mc.player.getInventory().selectedSlot = fireworkSlot;
                    mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND);
                    mc.player.getInventory().selectedSlot = lastSlot;
                    fireworkTick = 0;
                } else fireworkTick++;
                if (lastTick) {
                    mc.player.setVelocity(0, 0, 0);
                }
            }
        } else {
            fireworkTick = 10;
        }
    }

    public void deactivate() {
        fireworkTick = 10;
    }
}

чтоб остановить мотион надо держать кнопку вперёд
увидел в новых читах под рв эту функцию и решил её сделать


Пожалуйста, авторизуйтесь для просмотра ссылки.
Дайте базу зенита чистую пж
 
Код:
Expand Collapse Copy
package pl.PolskiDLC.implement.features.modules.movement;

import lombok.AccessLevel;
import lombok.experimental.FieldDefaults;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import pl.PolskiDLC.api.event.EventHandler;
import pl.PolskiDLC.api.feature.module.Module;
import pl.PolskiDLC.api.feature.module.ModuleCategory;
import pl.PolskiDLC.common.util.entity.PlayerInventoryUtil;
import pl.PolskiDLC.implement.events.player.TickEvent;

@FieldDefaults(level = AccessLevel.PRIVATE)
public class ElytraMotion extends Module {
    boolean lastTick = false;
    int fireworkTick;

    public ElytraMotion() {
        super("ElytraMotion", "Elytra Motion", ModuleCategory.MOVEMENT);
    }

    @EventHandler
    public void onTick(TickEvent e) {
        int lastSlot = mc.player.getInventory().selectedSlot;
        if (mc.player.getInventory().getStack(38).getItem() == Items.ELYTRA && mc.player.isGliding() && mc.options.forwardKey.isPressed()) {
            if (PlayerInventoryUtil.boolHotbarItem(Items.FIREWORK_ROCKET)) {
                int fireworkSlot = PlayerInventoryUtil.searchHotbarItem(Items.FIREWORK_ROCKET);
                if (fireworkTick >= 10) {
                    lastTick = true;
                    mc.player.getInventory().selectedSlot = fireworkSlot;
                    mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND);
                    mc.player.getInventory().selectedSlot = lastSlot;
                    fireworkTick = 0;
                } else fireworkTick++;
                if (lastTick) {
                    mc.player.setVelocity(0, 0, 0);
                }
            }
        } else {
            fireworkTick = 10;
        }
    }

    public void deactivate() {
        fireworkTick = 10;
    }
}

чтоб остановить мотион надо держать кнопку вперёд
увидел в новых читах под рв эту функцию и решил её сделать


Пожалуйста, авторизуйтесь для просмотра ссылки.
норм
 
Назад
Сверху Снизу