diff --git a/src/main/java/bypass/Alya.java b/src/main/java/bypass/Alya.java index 0c0613b3..36950a0e 100644 --- a/src/main/java/bypass/Alya.java +++ b/src/main/java/bypass/Alya.java @@ -133,6 +133,7 @@ public String[] initializeModules() { new Script(Category.EXPLOIT, "pingspoofer"), new Script(Category.OTHER, "hackerdetector"), new Script(Category.OTHER, "worldtime"), + new Script(Category.OTHER, "clip"), new Script(Category.OTHER, "dev") ); } diff --git a/src/main/java/bypass/lua/api/LuaMinecraftApi.java b/src/main/java/bypass/lua/api/LuaMinecraftApi.java index a300f15d..a0f0d4eb 100644 --- a/src/main/java/bypass/lua/api/LuaMinecraftApi.java +++ b/src/main/java/bypass/lua/api/LuaMinecraftApi.java @@ -32,6 +32,7 @@ import net.minecraft.network.Packet; import net.minecraft.network.play.client.C07PacketPlayerDigging; import net.minecraft.network.play.client.C0BPacketEntityAction; +import net.minecraft.network.play.client.C16PacketClientStatus; import net.minecraft.util.*; import org.jspecify.annotations.NonNull; import org.luaj.vm2.LuaTable; @@ -68,7 +69,7 @@ public static void registerEvents(EventBus eventBus) { HitboxEvent.class, event -> { if(hitboxExpansion >= 0) { - event.setExpansion(hitboxExpansion); + event.setExpansion(event.getExpansion() + hitboxExpansion); } }); eventBus.subscribe( @@ -234,6 +235,35 @@ public LuaValue call(LuaValue v) { return LuaValue.NIL; } }); + set( + "teleport", + new ThreeArgFunction() { + @Override + public LuaValue call(LuaValue xValue, LuaValue yValue, LuaValue zValue) { + if(minecraft.thePlayer == null || minecraft.getNetHandler() == null) { + return LuaValue.NIL; + } + final double targetX = xValue.todouble(); + final double targetY = yValue.todouble(); + final double targetZ = zValue.todouble(); + final double deltaX = targetX - minecraft.thePlayer.posX; + final double deltaY = targetY - minecraft.thePlayer.posY; + final double deltaZ = targetZ - minecraft.thePlayer.posZ; + final double distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ); + final int steps = Math.max(1, (int) Math.ceil(distance / 8.0)); + for(int step = 1; step <= steps; step++) { + final double progress = (double) step / steps; + minecraft.getNetHandler().addToSendQueue( + new net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition( + minecraft.thePlayer.posX + deltaX * progress, + minecraft.thePlayer.posY + deltaY * progress, + minecraft.thePlayer.posZ + deltaZ * progress, + false)); + } + minecraft.thePlayer.setPosition(targetX, targetY, targetZ); + return LuaValue.NIL; + } + }); set( "getMotionX", new ZeroArgFunction() { @@ -821,6 +851,16 @@ public LuaValue call() { return LuaValue.NIL; } }); + set( + "isCollidedHorizontally", + new ZeroArgFunction() { + @Override + public LuaValue call() { + return minecraft.thePlayer != null + ? LuaValue.valueOf(minecraft.thePlayer.isCollidedHorizontally) + : LuaValue.FALSE; + } + }); set( "isOnEdge", new ZeroArgFunction() { @@ -1145,6 +1185,23 @@ public LuaValue call(LuaValue stateValue) { return LuaValue.NIL; } }); + set( + "sendClientStatus", + new OneArgFunction() { + @Override + public LuaValue call(LuaValue statusValue) { + if(minecraft.thePlayer != null && minecraft.getNetHandler() != null) { + String statusName = statusValue.isnil() ? "PERFORM_RESPAWN" : statusValue.tojstring(); + C16PacketClientStatus.EnumState state = switch(statusName) { + case "REQUEST_STATS" -> C16PacketClientStatus.EnumState.REQUEST_STATS; + case "OPEN_INVENTORY_ACHIEVEMENT" -> C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT; + default -> C16PacketClientStatus.EnumState.PERFORM_RESPAWN; + }; + minecraft.getNetHandler().addToSendQueue(new C16PacketClientStatus(state)); + } + return LuaValue.NIL; + } + }); set( "isOnSolidBlock", new ZeroArgFunction() { diff --git a/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java b/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java index 985b988a..a98b519c 100644 --- a/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java +++ b/src/main/java/net/minecraft/client/entity/EntityPlayerSP.java @@ -155,6 +155,7 @@ public void onUpdateWalkingPlayer() { if(this.isCurrentViewEntity()) { motionEvent = new MotionEvent(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround); Alya.getInstance().getEventBus().dispatch(motionEvent); + final boolean spoofedOnGround = motionEvent.isOnGround(); double d0 = this.posX - this.lastReportedPosX; double d1 = this.getEntityBoundingBox().minY - this.lastReportedPosY; double d2 = this.posZ - this.lastReportedPosZ; @@ -165,16 +166,16 @@ public void onUpdateWalkingPlayer() { if(this.ridingEntity == null) { if(flag2 && flag3) { - this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.rotationYaw, this.rotationPitch, spoofedOnGround)); } else if(flag2) { - this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.posX, this.getEntityBoundingBox().minY, this.posZ, this.onGround)); + this.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.posX, this.getEntityBoundingBox().minY, this.posZ, spoofedOnGround)); } else if(flag3) { - this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, spoofedOnGround)); } else { - this.sendQueue.addToSendQueue(new C03PacketPlayer(this.onGround)); + this.sendQueue.addToSendQueue(new C03PacketPlayer(spoofedOnGround)); } } else { - this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, this.onGround)); + this.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(this.motionX, -999.0D, this.motionZ, this.rotationYaw, this.rotationPitch, spoofedOnGround)); flag2 = false; } diff --git a/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java b/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java index 01becbdd..d17d90ae 100644 --- a/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java +++ b/src/main/java/net/minecraft/client/gui/GuiDownloadTerrain.java @@ -1,63 +1,92 @@ package net.minecraft.client.gui; -import java.io.IOException; import net.minecraft.client.network.NetHandlerPlayClient; import net.minecraft.client.resources.I18n; import net.minecraft.network.play.client.C00PacketKeepAlive; import net.optifine.CustomLoadingScreen; import net.optifine.CustomLoadingScreens; +import java.io.IOException; + public class GuiDownloadTerrain extends GuiScreen { - private NetHandlerPlayClient netHandlerPlayClient; - private int progress; - private CustomLoadingScreen customLoadingScreen = CustomLoadingScreens.getCustomLoadingScreen(); - - public GuiDownloadTerrain(NetHandlerPlayClient netHandler) { - this.netHandlerPlayClient = netHandler; - } - - /** - * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of - * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl - * Keyboard key code) - */ - protected void keyTyped(char typedChar, int keyCode) throws IOException {} - - /** - * Adds the buttons (and other controls) to the screen in question. Called when the gui is - * displayed and when the window resizes, the buttonList is cleared beforehand. - */ - public void initGui() { - this.buttonList.clear(); - } - - /** Called from the main game loop to update the screen. */ - public void updateScreen() { - ++this.progress; - - if (this.progress % 20 == 0) { - this.netHandlerPlayClient.addToSendQueue(new C00PacketKeepAlive()); + private NetHandlerPlayClient netHandlerPlayClient; + private int progress; + private CustomLoadingScreen customLoadingScreen = CustomLoadingScreens.getCustomLoadingScreen(); + private GuiButton cancelButton; + + public GuiDownloadTerrain(NetHandlerPlayClient netHandler) { + this.netHandlerPlayClient = netHandler; + } + + /** + * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of + * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl + * Keyboard key code) + */ + protected void keyTyped(char typedChar, int keyCode) throws IOException { + } + + /** + * Adds the buttons (and other controls) to the screen in question. Called when the gui is + * displayed and when the window resizes, the buttonList is cleared beforehand. + */ + public void initGui() { + this.buttonList.clear(); + this.cancelButton = new GuiButton(0, this.width / 2 - 100, this.height / 2 + 20, "Cancel"); + this.buttonList.add(this.cancelButton); + } + + /** + * Called from the main game loop to update the screen. + */ + public void updateScreen() { + ++this.progress; + + if(this.progress % 20 == 0) { + this.netHandlerPlayClient.addToSendQueue(new C00PacketKeepAlive()); + } } - } - - /** Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks */ - public void drawScreen(int mouseX, int mouseY, float partialTicks) { - if (this.customLoadingScreen != null) { - this.customLoadingScreen.drawBackground(this.width, this.height); - } else { - this.drawBackground(0); + + protected void actionPerformed(GuiButton button) throws IOException { + if(button.id == 0) { + button.enabled = false; + boolean singleplayer = this.mc.isIntegratedServerRunning(); + + if(this.mc.theWorld != null) { + this.mc.theWorld.sendQuittingDisconnectingPacket(); + } + this.mc.loadWorld(null); + + if(singleplayer) { + this.mc.displayGuiScreen(new GuiMainMenu()); + } else { + this.mc.displayGuiScreen(new GuiMultiplayer(new GuiMainMenu())); + } + } } - this.drawCenteredString( - I18n.format("multiplayer.downloadingTerrain", new Object[0]), - this.width / 2, - this.height / 2 - 50, - 16777215); - super.drawScreen(mouseX, mouseY, partialTicks); - } - - /** Returns true if this gui should pause the game when it is displayed in single-player */ - public boolean doesGuiPauseGame() { - return false; - } + /** + * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks + */ + public void drawScreen(int mouseX, int mouseY, float partialTicks) { + if(this.customLoadingScreen != null) { + this.customLoadingScreen.drawBackground(this.width, this.height); + } else { + this.drawBackground(0); + } + + this.drawCenteredString( + I18n.format("multiplayer.downloadingTerrain", new Object[0]), + this.width / 2, + this.height / 2, + 16777215); + super.drawScreen(mouseX, mouseY, partialTicks); + } + + /** + * Returns true if this gui should pause the game when it is displayed in single-player + */ + public boolean doesGuiPauseGame() { + return false; + } } diff --git a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java index c83bd4dd..90a2107b 100644 --- a/src/main/java/net/minecraft/client/renderer/EntityRenderer.java +++ b/src/main/java/net/minecraft/client/renderer/EntityRenderer.java @@ -358,43 +358,42 @@ public void getMouseOver(float partialTicks) { if(entity != null && this.mc.theWorld != null) { this.mc.mcProfiler.startSection("pick"); this.mc.pointedEntity = null; - double d0 = (double) this.mc.playerController.getBlockReachDistance(); + double blockReach = (double) this.mc.playerController.getBlockReachDistance(); + this.mc.objectMouseOver = entity.rayTrace(blockReach, partialTicks); + double blockDistance = blockReach; Vec3 vec3 = entity.getPositionEyes(partialTicks); boolean flag = false; - int i = 3; if(this.mc.playerController.extendedReach()) { - d0 = 6.0D; - } - - this.mc.objectMouseOver = entity.rayTrace(d0, partialTicks); - double d1 = d0; - - final ReachEvent reachEvent = new ReachEvent(d0); - Alya.getInstance().getEventBus().dispatch(reachEvent); - double reachDistance = reachEvent.getReachDistance(); - boolean reachModified = reachDistance != d0; - d0 = reachDistance; - - if(!this.mc.playerController.extendedReach() && d0 > 3.0D) { + blockReach = 6.0D; + blockDistance = 6.0D; + } else if(blockReach > 3.0D) { flag = true; } if(this.mc.objectMouseOver != null) { - d1 = this.mc.objectMouseOver.hitVec.distanceTo(vec3); + blockDistance = this.mc.objectMouseOver.hitVec.distanceTo(vec3); + } + + final ReachEvent reachEvent = new ReachEvent(3.0D); + Alya.getInstance().getEventBus().dispatch(reachEvent); + double entityReach = reachEvent.getReachDistance(); + if(this.mc.playerController.extendedReach()) { + entityReach = Math.max(entityReach, 6.0D); } + double searchDistance = Math.max(blockReach, entityReach); Vec3 vec31 = entity.getLook(partialTicks); - Vec3 vec32 = vec3.addVector(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0); + Vec3 vec32 = vec3.addVector(vec31.xCoord * searchDistance, vec31.yCoord * searchDistance, vec31.zCoord * searchDistance); this.pointedEntity = null; Vec3 vec33 = null; - float f = 1.0F; - List list = this.mc.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand((double) f, (double) f, (double) f), Predicates.and(EntitySelectors.NOT_SPECTATING, new Predicate() { + float f = Math.max(1.0F, 1.0F + (float) (entityReach - 3.0D)); + List list = this.mc.theWorld.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec31.xCoord * searchDistance, vec31.yCoord * searchDistance, vec31.zCoord * searchDistance).expand((double) f, (double) f, (double) f), Predicates.and(EntitySelectors.NOT_SPECTATING, new Predicate() { public boolean apply(Entity p_apply_1_) { return p_apply_1_.canBeCollidedWith(); } })); - double d2 = d1; + double bestEntityDistance = this.mc.objectMouseOver != null ? blockDistance : searchDistance; for(Entity value : list) { float f1 = ((Entity) value).getCollisionBorderSize(); @@ -402,15 +401,15 @@ public boolean apply(Entity p_apply_1_) { MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(vec3, vec32); if(axisalignedbb.isVecInside(vec3)) { - if(d2 >= 0.0D) { + if(bestEntityDistance >= 0.0D) { this.pointedEntity = (Entity) value; vec33 = movingobjectposition == null ? vec3 : movingobjectposition.hitVec; - d2 = 0.0D; + bestEntityDistance = 0.0D; } } else if(movingobjectposition != null) { double d3 = vec3.distanceTo(movingobjectposition.hitVec); - if(d3 < d2 || d2 == 0.0D) { + if(d3 < bestEntityDistance || bestEntityDistance == 0.0D) { boolean flag1 = false; if(Reflector.ForgeEntity_canRiderInteract.exists()) { @@ -418,25 +417,25 @@ public boolean apply(Entity p_apply_1_) { } if(!flag1 && (Entity) value == entity.ridingEntity) { - if(d2 == 0.0D) { + if(bestEntityDistance == 0.0D) { this.pointedEntity = (Entity) value; vec33 = movingobjectposition.hitVec; } } else { this.pointedEntity = (Entity) value; vec33 = movingobjectposition.hitVec; - d2 = d3; + bestEntityDistance = d3; } } } } - if(this.pointedEntity != null && flag && vec3.distanceTo(vec33) > (reachModified ? d0 : 3.0D)) { + if(this.pointedEntity != null && flag && vec3.distanceTo(vec33) > entityReach) { this.pointedEntity = null; this.mc.objectMouseOver = new MovingObjectPosition(MovingObjectPosition.MovingObjectType.MISS, vec33, (EnumFacing) null, new BlockPos(vec33)); } - if(this.pointedEntity != null && (d2 < d1 || this.mc.objectMouseOver == null)) { + if(this.pointedEntity != null && (bestEntityDistance < blockDistance || this.mc.objectMouseOver == null)) { this.mc.objectMouseOver = new MovingObjectPosition(this.pointedEntity, vec33); if(this.pointedEntity instanceof EntityLivingBase || this.pointedEntity instanceof EntityItemFrame) { diff --git a/src/main/java/net/minecraft/entity/Entity.java b/src/main/java/net/minecraft/entity/Entity.java index 65601671..4375fd1f 100644 --- a/src/main/java/net/minecraft/entity/Entity.java +++ b/src/main/java/net/minecraft/entity/Entity.java @@ -1,5 +1,7 @@ package net.minecraft.entity; +import bypass.Alya; +import bypass.event.events.HitboxEvent; import java.util.List; import java.util.Random; import java.util.UUID; @@ -958,7 +960,11 @@ public void spawnRunningParticles() { if (this.isSprinting() && !this.isInWater()) { - this.createRunningParticles(); + double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ; + if (d0 > 0.0001D) + { + this.createRunningParticles(); + } } } @@ -1704,7 +1710,9 @@ public void setPositionAndRotation2(double x, double y, double z, float yaw, flo public float getCollisionBorderSize() { - return 0.1F; + HitboxEvent hitboxEvent = new HitboxEvent(0.1F); + Alya.getInstance().getEventBus().dispatch(hitboxEvent); + return hitboxEvent.getExpansion(); } public Vec3 getLookVec() diff --git a/src/main/resources/lua/alya.d.lua b/src/main/resources/lua/alya.d.lua index 6665a8a7..07cd1067 100644 --- a/src/main/resources/lua/alya.d.lua +++ b/src/main/resources/lua/alya.d.lua @@ -355,6 +355,11 @@ function AlyaMC.getPlayerX() end function AlyaMC.getPlayerY() end ---@return number function AlyaMC.getPlayerZ() end +---teleports the player to the given position (sends position packets in steps of 8 blocks) +---@param x number +---@param y number +---@param z number +function AlyaMC.teleport(x, y, z) end ---@return number function AlyaMC.getMotionX() end ---@return number @@ -471,6 +476,10 @@ function AlyaMC.setHitboxExpansion(expansion) end ---resets entity hitbox expansion to default function AlyaMC.resetHitboxExpansion() end +---returns true if the player is collided horizontally against a block +---@return boolean +function AlyaMC.isCollidedHorizontally() end + ---sends a chat message to the server ---@param message string function AlyaMC.sendChatMessage(message) end @@ -479,6 +488,10 @@ function AlyaMC.sendChatMessage(message) end ---@param state boolean true for START_SPRINTING, false for STOP_SPRINTING function AlyaMC.sendSprintPacket(state) end +---sends a C16PacketClientStatus packet to the server +---@param status? "PERFORM_RESPAWN"|"REQUEST_STATS"|"OPEN_INVENTORY_ACHIEVEMENT" defaults to "PERFORM_RESPAWN" +function AlyaMC.sendClientStatus(status) end + ---breaks a block using the specified action and position ---@param action integer 0 = START_DESTROY_BLOCK, 1 = STOP_DESTROY_BLOCK, 2 = ABORT_DESTROY_BLOCK ---@param x integer block x diff --git a/src/main/resources/lua/modules/combat/hitboxes.lua b/src/main/resources/lua/modules/combat/hitboxes.lua index 7a238f29..5072f834 100644 --- a/src/main/resources/lua/modules/combat/hitboxes.lua +++ b/src/main/resources/lua/modules/combat/hitboxes.lua @@ -19,7 +19,7 @@ --]] local moduleTable = alya.modules.register("Hitboxes", "Expands entity hitboxes", "COMBAT") -local expansion = moduleTable.addNumberSetting("Expansion", "", 0.1, 0.1, 1, 0.01) +local expansion = moduleTable.addNumberSetting("Expansion", "", 0.2, 0.05, 1, 0.01) alya.events.on("motion", function(event) if not moduleTable.isEnabled() then return end diff --git a/src/main/resources/lua/modules/combat/reach.lua b/src/main/resources/lua/modules/combat/reach.lua index 80e8cb8b..1f78c293 100644 --- a/src/main/resources/lua/modules/combat/reach.lua +++ b/src/main/resources/lua/modules/combat/reach.lua @@ -20,19 +20,17 @@ local moduleTable = alya.modules.register("Reach", "Extends your attack range", "COMBAT") local reachRange = moduleTable.addNumberSetting("Reach Range", "", 3, 3, 6, 0.1) +reachRange.setRangeEnabled(true) +reachRange.setSecondValue(3.5) local chance = moduleTable.addNumberSetting("Chance", "Chance for reach to be applied", 70, 0, 100, 1) -local function getEffectiveMax() - return reachRange.getSecondValue() -end - alya.events.on("motion", function(event) if not moduleTable.isEnabled() then return end if not event.isPre() then return end - local effectiveMax = getEffectiveMax() - local minR = reachRange.getValue() - local reach = minR + math.random() * (effectiveMax - minR) + local minR = math.min(reachRange.getValue(), reachRange.getSecondValue()) + local maxR = math.max(reachRange.getValue(), reachRange.getSecondValue()) + local reach = minR + math.random() * (maxR - minR) if math.random() < chance.getValue() / 100 then alya.mc.setReach(reach) diff --git a/src/main/resources/lua/modules/exploit/disabler.lua b/src/main/resources/lua/modules/exploit/disabler.lua index ef250d12..54b62cb5 100644 --- a/src/main/resources/lua/modules/exploit/disabler.lua +++ b/src/main/resources/lua/modules/exploit/disabler.lua @@ -19,6 +19,12 @@ --]] local moduleTable = alya.modules.register("Disabler", "Attempts to disable certain checks on anticheats", "EXPLOIT") -local mode = moduleTable.addModeSetting("Mode", "Disabler Mode", "OmniSprint", "OmniSprint") +local mode = moduleTable.addModeSetting("Mode", "Disabler Mode", "OmniSprint", "OmniSprint", "Spartan") +local delay = moduleTable.addNumberSetting("Delay", "Delay in milliseconds", 50, 0, 5000, 10) +delay.setVisibility(function() return mode.is("Spartan") end) + local createOmniSprintMode = loadScript("/lua/modules/exploit/disabler/omnisprint.lua") +local createSpartanMode = loadScript("/lua/modules/exploit/disabler/spartan.lua") + createOmniSprintMode(moduleTable, mode) +createSpartanMode(moduleTable, mode, delay) diff --git a/src/main/resources/lua/modules/exploit/disabler/spartan.lua b/src/main/resources/lua/modules/exploit/disabler/spartan.lua new file mode 100644 index 00000000..0909ced1 --- /dev/null +++ b/src/main/resources/lua/modules/exploit/disabler/spartan.lua @@ -0,0 +1,37 @@ +--[[ + * Copyright (c) 2026 Alya Client. + * + * Alya Client is a free, open-source Minecraft hacked client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--]] + +local function createSpartanMode(moduleTable, modeSettings, delaySetting) + local timer = alya.timer.create() + + moduleTable.onEnable(function() + timer.reset() + end) + + alya.events.on("update", function() + if not moduleTable.isEnabled() then return end + if not modeSettings.is("Spartan") then return end + + if timer.hasElapsedAndReset(delaySetting.getValueAsInt(), true) then + alya.mc.sendClientStatus("PERFORM_RESPAWN") + end + end) +end +return createSpartanMode diff --git a/src/main/resources/lua/modules/movement/flight.lua b/src/main/resources/lua/modules/movement/flight.lua index 2a157c98..df93fbd8 100644 --- a/src/main/resources/lua/modules/movement/flight.lua +++ b/src/main/resources/lua/modules/movement/flight.lua @@ -19,10 +19,14 @@ --]] local moduleTable = alya.modules.register("Flight", "Airplane", "MOVEMENT") -local mode = moduleTable.addModeSetting("Mode", "Flight mode", "Motion", "Motion", "Static") +local mode = moduleTable.addModeSetting("Mode", "Flight mode", "Motion", "Motion", "Static", "Air Jump") local speed = moduleTable.addNumberSetting("Speed", "How fast", 1.0, 0.1, 10.0) speed.setVisibility(function() return mode.is("Motion") end) + local createMotionFlightMode = loadScript("/lua/modules/movement/flight/motion.lua") local createStaticFlightMode = loadScript("/lua/modules/movement/flight/static.lua") +local createAirJumpFlightMode = loadScript("/lua/modules/movement/flight/airjump.lua") + createMotionFlightMode(moduleTable, mode, speed) createStaticFlightMode(moduleTable, mode) +createAirJumpFlightMode(moduleTable, mode) diff --git a/src/main/resources/lua/modules/movement/flight/airjump.lua b/src/main/resources/lua/modules/movement/flight/airjump.lua new file mode 100644 index 00000000..7dc295c1 --- /dev/null +++ b/src/main/resources/lua/modules/movement/flight/airjump.lua @@ -0,0 +1,58 @@ +--[[ + * Copyright (c) 2026 Alya Client. + * + * Alya Client is a free, open-source Minecraft hacked client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--]] + +local mc = alya.mc + +local function createAirJumpMode(moduleTable, modeSettings) + local timer = alya.timer.create() + local hoverY = nil + local sprint = moduleTable.addBooleanSetting("Sprint", "Sprint while air jumping", true) + sprint.setVisibility(function() return modeSettings.is("Air Jump") end) + + alya.events.on("playermove", function(_) + if not moduleTable.isEnabled() then + hoverY = nil + return + end + if not modeSettings.is("Air Jump") then + hoverY = nil + return + end + + mc.setSprinting(sprint.isEnabled() and alya.movement.isMoving()) + + local y = mc.getPlayerY() + if hoverY == nil then hoverY = y end + + if mc.isJumpPressed() then + if timer.hasElapsed(150) then + mc.jump() + timer.reset() + end + hoverY = y + elseif mc.isSneakPressed() then + hoverY = y + elseif y <= hoverY and mc.getMotionY() <= 0 and timer.hasElapsed(150) then + mc.jump() + timer.reset() + end + end) +end +return createAirJumpMode diff --git a/src/main/resources/lua/modules/movement/flight/static.lua b/src/main/resources/lua/modules/movement/flight/static.lua index ee199795..cd1d049d 100644 --- a/src/main/resources/lua/modules/movement/flight/static.lua +++ b/src/main/resources/lua/modules/movement/flight/static.lua @@ -19,11 +19,11 @@ --]] local function createStaticFlightMode(moduleTable, modeSettings) - alya.events.on("motion", function(event) + alya.events.on("playermove", function(event) if not moduleTable.isEnabled() then return end if not modeSettings.is("Static") then return end alya.mc.setMotionY(0) - alya.movement.setSpeed(0) + event.cancel() end) end return createStaticFlightMode diff --git a/src/main/resources/lua/modules/movement/sprint.lua b/src/main/resources/lua/modules/movement/sprint.lua index 3884ed71..eed1295a 100644 --- a/src/main/resources/lua/modules/movement/sprint.lua +++ b/src/main/resources/lua/modules/movement/sprint.lua @@ -23,7 +23,7 @@ local omniSprint = moduleTable.addBooleanSetting("OmniSprint", "Sprint in all di alya.events.on("playerinput", function(event) if not moduleTable.isEnabled() then return end - if not alya.movement.isMoving() then + if not alya.movement.isMoving() or alya.mc.isCollidedHorizontally() then alya.mc.setSprinting(false) return end diff --git a/src/main/resources/lua/modules/other/clip.lua b/src/main/resources/lua/modules/other/clip.lua new file mode 100644 index 00000000..f26e34fa --- /dev/null +++ b/src/main/resources/lua/modules/other/clip.lua @@ -0,0 +1,48 @@ +--[[ + * Copyright (c) 2026 Alya Client. + * + * Alya Client is a free, open-source Minecraft hacked client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--]] + + +local function parseDistance(args, usage) + local distance = tonumber(args[1]) + if not distance then + alya.chat.error("Usage: " .. usage) + return nil + end + return distance +end + +alya.commands.register("vclip", "Teleports you vertically by the given blocks", function(args) + local distance = parseDistance(args, ".vclip ") + if not distance then return end + local mc = alya.mc + mc.teleport(mc.getPlayerX(), mc.getPlayerY() + distance, mc.getPlayerZ()) + alya.chat.success("Clipped " .. distance .. " blocks vertically") +end) + +alya.commands.register("hclip", "Teleports you forward by the given blocks", function(args) + local distance = parseDistance(args, ".hclip ") + if not distance then return end + local mc = alya.mc + local yaw = math.rad(mc.getYaw()) + local x = mc.getPlayerX() - math.sin(yaw) * distance + local z = mc.getPlayerZ() + math.cos(yaw) * distance + mc.teleport(x, mc.getPlayerY(), z) + alya.chat.success("Clipped " .. distance .. " blocks horizontally") +end) diff --git a/src/main/resources/lua/modules/player/nofall/vanilla.lua b/src/main/resources/lua/modules/player/nofall/vanilla.lua index 7520d1ba..18ac392a 100644 --- a/src/main/resources/lua/modules/player/nofall/vanilla.lua +++ b/src/main/resources/lua/modules/player/nofall/vanilla.lua @@ -21,8 +21,9 @@ local function createVanillaNoFallMode(moduleTable, modeSettings) alya.events.on("motion", function(event) if not moduleTable.isEnabled() then return end + if not event.isPre() then return end if not modeSettings.is("Vanilla") then return end - if alya.mc.getFallDistance() < 3.01 then + if alya.mc.getFallDistance() > 2.5 then event.setOnGround(true) alya.mc.setFallDistance(0) end diff --git a/src/main/resources/lua/modules/player/nofall/verus.lua b/src/main/resources/lua/modules/player/nofall/verus.lua index 6264e40f..c6bf62df 100644 --- a/src/main/resources/lua/modules/player/nofall/verus.lua +++ b/src/main/resources/lua/modules/player/nofall/verus.lua @@ -21,6 +21,7 @@ local function createVerusNoFallMode(moduleTable, modeSettings) alya.events.on("motion", function(event) if not moduleTable.isEnabled() then return end + if not event.isPre() then return end if not modeSettings.is("Verus") then return end if alya.mc.getFallDistance() > 3.5 then alya.mc.setMotionY(0.0) diff --git a/src/main/resources/lua/modules/visual/esp.lua b/src/main/resources/lua/modules/visual/esp.lua index e7474eea..42769afd 100644 --- a/src/main/resources/lua/modules/visual/esp.lua +++ b/src/main/resources/lua/modules/visual/esp.lua @@ -55,7 +55,7 @@ alya.events.on("render3d", function(event) if hitboxesModule and hitboxesModule.isEnabled() then local expansion = hitboxesModule.getSetting("Expansion") if expansion then - espWidth = espWidth + (expansion.getValue() * 2.0) + espWidth = espWidth + 0.2 + (expansion.getValue() * 2.0) end end end