├── HI.MD ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── src └── main │ ├── java │ └── com │ │ └── syuto │ │ └── bytes │ │ ├── eventbus │ │ ├── Event.java │ │ ├── impl │ │ │ ├── TickEvent.java │ │ │ ├── PostMotionEvent.java │ │ │ ├── PreUpdateEvent.java │ │ │ ├── KeyEvent.java │ │ │ ├── WorldJoinEvent.java │ │ │ ├── RotationEvent.java │ │ │ ├── ChatEvent.java │ │ │ ├── RenderTickEvent.java │ │ │ ├── RenderWorldEvent.java │ │ │ ├── SlowDownEvent.java │ │ │ ├── PacketSentEvent.java │ │ │ ├── PacketReceivedEvent.java │ │ │ ├── AttackEntityEvent.java │ │ │ └── PreMotionEvent.java │ │ ├── EventHandler.java │ │ ├── Handlers.java │ │ └── EventBus.java │ │ ├── module │ │ ├── api │ │ │ └── Category.java │ │ ├── impl │ │ │ ├── combat │ │ │ │ ├── KeepSprint.java │ │ │ │ ├── ElytraSwap.java │ │ │ │ ├── Velocity.java │ │ │ │ ├── AutoTotem.java │ │ │ │ ├── AttributeSwap.java │ │ │ │ ├── Criticals.java │ │ │ │ ├── Triggerbot.java │ │ │ │ ├── FakeLag.java │ │ │ │ └── AimAssist.java │ │ │ ├── misc │ │ │ │ ├── Bsod.java │ │ │ │ ├── Crash.java │ │ │ │ ├── Debugger.java │ │ │ │ └── Disabler.java │ │ │ ├── render │ │ │ │ ├── Animations.java │ │ │ │ ├── ThemeModule.java │ │ │ │ ├── ClickGUIModule.java │ │ │ │ ├── RenderingTest.java │ │ │ │ ├── Hud.java │ │ │ │ ├── RenderTest.java │ │ │ │ └── Esp.java │ │ │ ├── player │ │ │ │ ├── scaffold │ │ │ │ │ └── BlockData.java │ │ │ │ ├── FastPlace.java │ │ │ │ ├── AntiRacism.java │ │ │ │ ├── Blink.java │ │ │ │ ├── AutoPearl.java │ │ │ │ ├── ChestStealer.java │ │ │ │ ├── NoFall.java │ │ │ │ ├── PathFind.java │ │ │ │ └── Test.java │ │ │ └── movement │ │ │ │ ├── Sprint.java │ │ │ │ ├── NoSlow.java │ │ │ │ └── Flight.java │ │ ├── ModuleManager.java │ │ └── Module.java │ │ ├── mixin │ │ ├── PlayerEntityRendererMixin.java │ │ ├── SendPacketMixinAccessor.java │ │ ├── RenderMixin.java │ │ ├── ChatMixin.java │ │ ├── SoundManagerMixin.java │ │ ├── ClientPlayerNetworkHandlerMixin.java │ │ ├── MinecraftMixin.java │ │ ├── KeyboardMixin.java │ │ ├── TextRendererMixin.java │ │ ├── SendPacketMixin.java │ │ ├── DownloaderMixin.java │ │ ├── ClientPlayerInteractionManagerMixin.java │ │ ├── PlayerEntityMixin.java │ │ ├── AbstractClientPlayerMixin.java │ │ ├── KeyboardInputMixin.java │ │ ├── RenderWorldMixin.java │ │ ├── PacketReceivedMixin.java │ │ ├── EntityMixin.java │ │ ├── TitleScreenMixin.java │ │ ├── LivingEntityRendererMixin.java │ │ └── MinecraftClientMixin.java │ │ ├── utils │ │ └── impl │ │ │ ├── client │ │ │ ├── ChatUtils.java │ │ │ ├── ReflectionUtil.java │ │ │ ├── ClientUtil.java │ │ │ └── WinUtil.java │ │ │ ├── rotation │ │ │ └── MixinUtils.java │ │ │ ├── player │ │ │ ├── MovementUtil.java │ │ │ ├── InventoryUtil.java │ │ │ ├── PathFinder.java │ │ │ └── WorldUtil.java │ │ │ └── render │ │ │ ├── AnimationUtils.java │ │ │ └── Snow.java │ │ ├── setting │ │ ├── api │ │ │ └── SettingHolder.java │ │ ├── impl │ │ │ ├── BooleanSetting.java │ │ │ ├── NumberSetting.java │ │ │ ├── ColorSetting.java │ │ │ └── ModeSetting.java │ │ └── Setting.java │ │ ├── commands │ │ ├── impl │ │ │ ├── Toggle.java │ │ │ ├── Pathfind.java │ │ │ └── Bind.java │ │ ├── CommandManager.java │ │ └── Command.java │ │ └── Byte.java │ ├── resources │ ├── assets │ │ ├── byte │ │ │ ├── icon.png │ │ │ ├── capes │ │ │ │ └── cape.png │ │ │ ├── sounds.json │ │ │ ├── fonts │ │ │ │ ├── regular.ttf │ │ │ │ └── ubuntu.ttf │ │ │ └── background │ │ │ │ ├── back.png │ │ │ │ └── snow.png │ │ └── minecraft │ │ │ └── textures │ │ │ └── combat.png │ ├── fabric.mod.json │ └── byte.mixins.json │ └── kotlin │ └── dev │ └── blend │ ├── util │ ├── IAccessor.kt │ ├── render │ │ ├── Alignment.kt │ │ ├── Gradient.kt │ │ ├── ResourceManager.kt │ │ ├── Resources.kt │ │ └── ColorUtil.kt │ ├── interfaces │ │ └── IScreen.kt │ ├── animations │ │ ├── Animations.kt │ │ └── AbstractAnimation.kt │ └── misc │ │ └── MiscUtil.kt │ ├── ui │ ├── dropdown │ │ ├── components │ │ │ ├── AbstractValueComponent.kt │ │ │ ├── values │ │ │ │ ├── ModeValueComponent.kt │ │ │ │ ├── BooleanValueComponent.kt │ │ │ │ └── NumberValueComponent.kt │ │ │ └── CategoryComponent.kt │ │ └── DropdownClickGUI.kt │ └── AbstractUIComponent.kt │ └── ThemeHandler.kt ├── README.md ├── settings.gradle ├── .gitattributes ├── gradle.properties ├── .gitignore ├── .github ├── dependabot.yml └── workflows │ └── build.yml └── gradlew.bat /HI.MD: -------------------------------------------------------------------------------- 1 | hi gyatts and gurls 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/Event.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus; 2 | 3 | public interface Event { 4 | } 5 | -------------------------------------------------------------------------------- /src/main/resources/assets/byte/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/src/main/resources/assets/byte/icon.png -------------------------------------------------------------------------------- /src/main/resources/assets/byte/capes/cape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/src/main/resources/assets/byte/capes/cape.png -------------------------------------------------------------------------------- /src/main/resources/assets/byte/sounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "music.fem": { 3 | "sounds": [ 4 | "music/fem" 5 | ] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/main/resources/assets/byte/fonts/regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/src/main/resources/assets/byte/fonts/regular.ttf -------------------------------------------------------------------------------- /src/main/resources/assets/byte/fonts/ubuntu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/src/main/resources/assets/byte/fonts/ubuntu.ttf -------------------------------------------------------------------------------- /src/main/resources/assets/byte/background/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/src/main/resources/assets/byte/background/back.png -------------------------------------------------------------------------------- /src/main/resources/assets/byte/background/snow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/src/main/resources/assets/byte/background/snow.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/textures/combat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyutoBestCoder/Byte-client/HEAD/src/main/resources/assets/minecraft/textures/combat.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Billionaire stop skidding from this repo or I will pursue legal action! 2 | 3 | 4 | use fabric kotlin language compatibility mod for 1.21.4 5 | use graalvm 21 to build 6 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/TickEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | 5 | public class TickEvent implements Event { 6 | } 7 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/IAccessor.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util 2 | 3 | import net.minecraft.client.MinecraftClient 4 | 5 | interface IAccessor { 6 | val mc get() = MinecraftClient.getInstance()!! 7 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/PostMotionEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | 5 | public class PostMotionEvent implements Event { 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/PreUpdateEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | 5 | public class PreUpdateEvent implements Event { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # 2 | # https://help.github.com/articles/dealing-with-line-endings/ 3 | # 4 | # Linux start script should use lf 5 | /gradlew text eol=lf 6 | 7 | # These are Windows script files and should use crlf 8 | *.bat text eol=crlf 9 | 10 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/render/Alignment.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.render 2 | 3 | enum class Alignment { 4 | TOP_LEFT, 5 | TOP_CENTER, 6 | TOP_RIGHT, 7 | CENTER_LEFT, 8 | CENTER, 9 | CENTER_RIGHT, 10 | BOTTOM_LEFT, 11 | BOTTOM_CENTER, 12 | BOTTOM_RIGHT 13 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/api/Category.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.api; 2 | 3 | public enum Category { 4 | COMBAT, 5 | MOVEMENT, 6 | PLAYER, 7 | RENDER, 8 | EXPLOIT; 9 | public final String properName = name().toUpperCase().charAt(0) + name().toLowerCase().substring(1); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/PlayerEntityRendererMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import net.minecraft.client.render.entity.PlayerEntityRenderer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(PlayerEntityRenderer.class) 7 | public abstract class PlayerEntityRendererMixin { 8 | 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/KeyEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Getter; 5 | import lombok.RequiredArgsConstructor; 6 | 7 | @Getter 8 | @RequiredArgsConstructor 9 | public class KeyEvent implements Event { 10 | private final int key, scancode, action, modifiers; 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/EventHandler.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | @Retention(RetentionPolicy.RUNTIME) 9 | @Target(ElementType.METHOD) 10 | public @interface EventHandler { 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/KeepSprint.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.module.Module; 4 | import com.syuto.bytes.module.api.Category; 5 | 6 | public class KeepSprint extends Module { 7 | public KeepSprint() { 8 | super("KeepSprint", "Removes the slow down while attacking", Category.COMBAT); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx8G 2 | org.gradle.parallel=true 3 | 4 | 5 | minecraft_version=1.21.4 6 | yarn_mappings=1.21.4+build.4 7 | loader_version=0.16.9 8 | 9 | fabric_version=0.114.0+1.21.4 10 | 11 | mod_version=1.0.0 12 | maven_group=com.syuto.bytes 13 | archives_base_name=byte 14 | 15 | kotlin_loader_version=1.12.3+kotlin.2.0.21 16 | minecraft_lwjgl_version=3.3.3 17 | imgui_version=1.86.4 18 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/interfaces/IScreen.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.interfaces 2 | 3 | interface IScreen { 4 | fun init() 5 | fun render(mouseX: Int, mouseY: Int) 6 | fun click(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean 7 | fun release(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean 8 | fun key(key: Int, scancode: Int, modifiers: Int): Boolean 9 | fun close() 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/WorldJoinEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Getter; 5 | import net.minecraft.entity.Entity; 6 | 7 | public class WorldJoinEvent implements Event { 8 | 9 | @Getter 10 | public int entityId; 11 | 12 | public WorldJoinEvent(int entityId) { 13 | this.entityId = entityId; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # gradle 2 | 3 | .kotlin/ 4 | .gradle/ 5 | build/ 6 | out/ 7 | classes/ 8 | 9 | # eclipse 10 | 11 | *.launch 12 | 13 | # idea 14 | 15 | .idea/ 16 | *.iml 17 | *.ipr 18 | *.iws 19 | 20 | # vscode 21 | 22 | .settings/ 23 | .vscode/ 24 | bin/ 25 | .classpath 26 | .project 27 | 28 | # macos 29 | 30 | *.DS_Store 31 | 32 | # fabric 33 | 34 | run/ 35 | 36 | # java 37 | 38 | hs_err_*.log 39 | replay_*.log 40 | *.hprof 41 | *.jfr 42 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/RotationEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | @Setter 8 | @Getter 9 | public class RotationEvent implements Event { 10 | public float yaw, pitch; 11 | 12 | public RotationEvent(float yaw, float pitch) { 13 | this.yaw = yaw; 14 | this.pitch = pitch; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/misc/Bsod.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.misc; 2 | 3 | import com.syuto.bytes.module.Module; 4 | import com.syuto.bytes.module.api.Category; 5 | import com.syuto.bytes.utils.impl.client.WinUtil; 6 | 7 | public class Bsod extends Module { 8 | public Bsod() { 9 | super("BSOD", "Cause a BSOD", Category.EXPLOIT); 10 | } 11 | 12 | @Override 13 | protected void onEnable() { 14 | WinUtil.bsod(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/render/Gradient.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.render 2 | 3 | import dev.blend.util.IAccessor 4 | import net.minecraft.client.MinecraftClient 5 | import java.awt.Color 6 | 7 | class Gradient( 8 | val primary: Color, 9 | val secondary: Color, 10 | var origin: Point = Point(0, 0), 11 | var end: Point = Point(MinecraftClient.getInstance().window.width, MinecraftClient.getInstance().window.height) 12 | ): IAccessor 13 | 14 | class Point(val x: Number, val y: Number) 15 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/ChatEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | 7 | public class ChatEvent implements Event { 8 | @Getter 9 | @Setter 10 | private String message; 11 | @Getter 12 | @Setter 13 | private boolean canceled; 14 | 15 | public ChatEvent(String message) { 16 | this.message = message; 17 | this.canceled = false; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/RenderTickEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import net.minecraft.client.gui.DrawContext; 5 | 6 | public class RenderTickEvent implements Event { 7 | 8 | public float partialTicks; 9 | public DrawContext context; 10 | 11 | public RenderTickEvent(float partialTicks, DrawContext context) { 12 | this.partialTicks = partialTicks; 13 | this.context = context; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/RenderWorldEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import net.minecraft.client.util.math.MatrixStack; 5 | 6 | public class RenderWorldEvent implements Event { 7 | 8 | public float partialTicks; 9 | public MatrixStack matrixStack; 10 | 11 | public RenderWorldEvent(float partialTicks, MatrixStack matrixStack) { 12 | this.partialTicks = partialTicks; 13 | this.matrixStack = matrixStack; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/client/ChatUtils.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.client; 2 | 3 | import net.minecraft.text.Text; 4 | 5 | import static com.syuto.bytes.Byte.mc; 6 | 7 | public class ChatUtils { 8 | 9 | public static void print(Object message) { 10 | if (mc.player != null && mc.world != null) { 11 | String m = "§7[" + "§3Byte§7" + "] §f" + message; 12 | mc.player.sendMessage(Text.of(m),false); 13 | //mc.inGameHud.getChatHud().addMessage(Text.of(m)); 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/SendPacketMixinAccessor.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import net.minecraft.client.network.ClientCommonNetworkHandler; 4 | import net.minecraft.network.ClientConnection; 5 | import net.minecraft.network.packet.Packet; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Unique; 8 | import org.spongepowered.asm.mixin.gen.Accessor; 9 | 10 | @Mixin(ClientCommonNetworkHandler.class) 11 | public interface SendPacketMixinAccessor { 12 | 13 | @Accessor 14 | ClientConnection getConnection(); 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ui/dropdown/components/AbstractValueComponent.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.ui.dropdown.components 2 | 3 | import com.syuto.bytes.setting.Setting 4 | import dev.blend.ui.AbstractUIComponent 5 | 6 | abstract class AbstractValueComponent( 7 | val parent: ModuleComponent, 8 | open val value: Setting<*>, 9 | width: Double = 0.0, 10 | height: Double = 0.0, 11 | ): AbstractUIComponent( 12 | width = width, 13 | height = height 14 | ) { 15 | val padding = 5.0 16 | open fun isExpanding(): Boolean { 17 | return false 18 | } 19 | } -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to udate and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "gradle" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/render/Animations.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.render; 2 | 3 | import com.syuto.bytes.module.Module; 4 | import com.syuto.bytes.module.api.Category; 5 | import com.syuto.bytes.setting.impl.ModeSetting; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | public class Animations extends Module { 11 | 12 | public ModeSetting mode = new ModeSetting("Animation", this, "Exhibition", "Vanilla", "Spin"); 13 | 14 | 15 | public Animations() { 16 | super("Animations", "animations", Category.RENDER); 17 | } 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/Handlers.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus; 2 | 3 | import com.syuto.bytes.eventbus.impl.KeyEvent; 4 | import com.syuto.bytes.module.Module; 5 | import com.syuto.bytes.module.ModuleManager; 6 | import org.lwjgl.glfw.GLFW; 7 | 8 | public class Handlers { 9 | 10 | @EventHandler 11 | public void onKey(KeyEvent event) { 12 | if (event.getAction() == GLFW.GLFW_PRESS) { 13 | ModuleManager.modules.stream() 14 | .filter(m -> m.getKey() == event.getKey()) 15 | .forEach(Module::toggle); 16 | } 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/misc/Crash.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.misc; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.TickEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.utils.impl.client.ClientUtil; 8 | 9 | public class Crash extends Module { 10 | public Crash() { 11 | super("Crash", "Memory Corruption as a feature", Category.EXPLOIT); 12 | } 13 | 14 | @EventHandler 15 | void onTick(TickEvent e) { 16 | ClientUtil.crash(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/render/ResourceManager.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.render 2 | 3 | object ResourceManager { 4 | 5 | @JvmStatic 6 | fun init() { 7 | FontResources.init() 8 | ImageResources.init() 9 | } 10 | 11 | object FontResources { 12 | lateinit var regular: FontResource 13 | lateinit var ubuntu: FontResource 14 | fun init() { 15 | regular = FontResource("regular") 16 | ubuntu = FontResource("ubuntu") 17 | } 18 | } 19 | 20 | object ImageResources { 21 | fun init() { 22 | 23 | } 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/scaffold/BlockData.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player.scaffold; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import net.minecraft.util.math.BlockPos; 6 | import net.minecraft.util.math.Direction; 7 | import net.minecraft.util.math.Vec3d; 8 | 9 | @Getter 10 | @Setter 11 | public class BlockData { 12 | BlockPos position; 13 | Vec3d hit; 14 | Direction facing; 15 | 16 | public BlockData(BlockPos position, Vec3d hit, Direction facing) { 17 | this.position = position; 18 | this.hit = hit; 19 | this.facing = facing; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/SlowDownEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Setter; 5 | 6 | public class SlowDownEvent implements Event { 7 | private final Mode mode; 8 | @Setter 9 | private boolean canceled; 10 | 11 | public SlowDownEvent(final Mode mode) { 12 | this.mode = mode; 13 | this.canceled = false; 14 | } 15 | 16 | public boolean isCanceled() { 17 | return canceled; 18 | } 19 | 20 | public Mode getMode() { 21 | return mode; 22 | } 23 | 24 | public enum Mode { 25 | Item, Sprint 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/PacketSentEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Setter; 5 | import net.minecraft.network.packet.Packet; 6 | 7 | public class PacketSentEvent implements Event { 8 | private final Packet packet; 9 | @Setter 10 | private boolean canceled; 11 | 12 | public PacketSentEvent(Packet packet) { 13 | this.packet = packet; 14 | this.canceled = false; 15 | } 16 | 17 | public Packet getPacket() { 18 | return packet; 19 | } 20 | 21 | public boolean isCanceled() { 22 | return this.canceled; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/setting/api/SettingHolder.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.setting.api; 2 | 3 | import com.syuto.bytes.setting.Setting; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | import java.util.ArrayList; 7 | import java.util.List; 8 | 9 | public abstract class SettingHolder { 10 | public final List> values = new ArrayList<>(); 11 | @Nullable 12 | @SuppressWarnings("unchecked") 13 | public > S getSetting(final String name) { 14 | return (S) this.values.stream() 15 | .filter(s -> s.getName().equalsIgnoreCase(name)) 16 | .findFirst() 17 | .orElse(null); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/PacketReceivedEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Setter; 5 | import net.minecraft.network.packet.Packet; 6 | 7 | public class PacketReceivedEvent implements Event { 8 | @Setter 9 | private Packet packet; 10 | @Setter 11 | private boolean canceled; 12 | 13 | public PacketReceivedEvent(Packet packet) { 14 | this.packet = packet; 15 | this.canceled = false; 16 | } 17 | 18 | public Packet getPacket() { 19 | return packet; 20 | } 21 | 22 | public boolean isCanceled() { 23 | return canceled; 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/setting/impl/BooleanSetting.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.setting.impl; 2 | 3 | import com.syuto.bytes.setting.Setting; 4 | import com.syuto.bytes.setting.api.SettingHolder; 5 | 6 | import java.util.function.BooleanSupplier; 7 | 8 | public class BooleanSetting extends Setting { 9 | public BooleanSetting(String name, SettingHolder parent, BooleanSupplier visibility, Boolean value) { 10 | super(name, parent, visibility, value); 11 | } 12 | public BooleanSetting(String name, SettingHolder parent, Boolean defaultValue) { 13 | super(name, parent, defaultValue); 14 | } 15 | public void toggle() { 16 | setValue(!value); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/setting/Setting.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.setting; 2 | 3 | import com.syuto.bytes.setting.api.SettingHolder; 4 | import lombok.AllArgsConstructor; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | import java.util.function.BooleanSupplier; 9 | 10 | @Getter 11 | @Setter 12 | @AllArgsConstructor 13 | public abstract class Setting { 14 | public final String name; 15 | public final SettingHolder parent; 16 | public final BooleanSupplier visibility; 17 | public T value; 18 | 19 | protected Setting(String name, SettingHolder parent, T defaultValue) { 20 | this(name, parent, () -> true, defaultValue); 21 | parent.values.add(this); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/client/ReflectionUtil.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.client; 2 | 3 | import sun.misc.Unsafe; 4 | 5 | import java.lang.reflect.Field; 6 | 7 | public class ReflectionUtil { 8 | public static Unsafe theUnsafe = getUnsafe(); 9 | private static Unsafe getUnsafe() { 10 | try { 11 | Class unsafeKlass = Unsafe.class; 12 | Field theUnsafeField = unsafeKlass.getDeclaredField("theUnsafe"); 13 | theUnsafeField.setAccessible(true); 14 | return (Unsafe) theUnsafeField.get(null); 15 | } catch (Exception e) { 16 | e.printStackTrace(); 17 | throw new RuntimeException("Couldn't get the unsafe"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/AttackEntityEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | import lombok.Getter; 5 | import lombok.Setter; 6 | import net.minecraft.entity.Entity; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | 9 | public class AttackEntityEvent implements Event { 10 | @Getter 11 | private final AttackEntityEvent.Mode mode; 12 | @Getter 13 | private Entity target; 14 | 15 | @Getter 16 | @Setter 17 | private boolean cancelled; 18 | 19 | public AttackEntityEvent(Mode mode, Entity target) { 20 | this.mode = mode; 21 | this.target = target; 22 | } 23 | 24 | 25 | public enum Mode { 26 | Pre, Post 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/render/Resources.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.render 2 | 3 | import dev.blend.util.misc.MiscUtil 4 | import org.lwjgl.nanovg.NanoVG 5 | import java.nio.ByteBuffer 6 | 7 | class FontResource( 8 | fontName: String 9 | ) { 10 | private val resource: ByteBuffer 11 | val identifier: String = fontName 12 | .replace(' ', '_') 13 | .replace('-', '_') 14 | init { 15 | resource = MiscUtil.getResourceAsByteBuffer("fonts/$identifier.ttf") 16 | NanoVG.nvgCreateFontMem(DrawUtil.context, fontName, resource, false) 17 | } 18 | } 19 | 20 | class ImageResource( 21 | imageName: String, 22 | ) { 23 | val identifier = NanoVG.nvgCreateImageMem(DrawUtil.context, NanoVG.NVG_IMAGE_NEAREST, MiscUtil.getResourceAsByteBuffer("images/$imageName.png", 512)) 24 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/client/ClientUtil.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.client; 2 | 3 | import java.util.concurrent.ThreadLocalRandom; 4 | 5 | import static com.syuto.bytes.Byte.mc; 6 | 7 | public class ClientUtil { 8 | 9 | 10 | 11 | public static void crash() { 12 | long freeAddr = ReflectionUtil.theUnsafe.allocateMemory(1); 13 | ReflectionUtil.theUnsafe.freeMemory(freeAddr); 14 | ReflectionUtil.theUnsafe.setMemory( 15 | freeAddr-10 + ThreadLocalRandom.current().nextLong(-10, 11), 16 | ThreadLocalRandom.current().nextLong(1, 11), 17 | (byte) 0 18 | ); 19 | } 20 | 21 | 22 | public static boolean nullCheck() { 23 | return mc.player != null && mc.world != null; 24 | } 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "visuality", 4 | "version": "${version}", 5 | "name": "Visuality", 6 | "description": "Little visual improvements by adding a bunch of new particles.", 7 | "authors": [ 8 | "PinkGoosik" 9 | ], 10 | "contact": { 11 | "homepage": "https://fabricmc.net/", 12 | "sources": "https://github.com/FabricMC/fabric-example-mod" 13 | }, 14 | "license": "CC0-1.0", 15 | "icon": "assets/byte/icon.png", 16 | "environment": "*", 17 | "entrypoints": { 18 | "main": [ 19 | "com.syuto.bytes.Byte" 20 | ] 21 | }, 22 | "mixins": [ 23 | "byte.mixins.json" 24 | ], 25 | "depends": { 26 | "fabricloader": ">=0.16.9", 27 | "minecraft": "~1.21.4", 28 | "java": ">=21", 29 | "fabric-api": "*" 30 | }, 31 | "suggests": { 32 | "another-mod": "*" 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/render/ThemeModule.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.render; 2 | 3 | import com.syuto.bytes.module.Module; 4 | import com.syuto.bytes.module.api.Category; 5 | import com.syuto.bytes.setting.impl.ColorSetting; 6 | import com.syuto.bytes.setting.impl.ModeSetting; 7 | 8 | import java.awt.*; 9 | 10 | public class ThemeModule extends Module { 11 | 12 | public final ColorSetting accent = new ColorSetting("Accent", this, new Color(0, 160, 255)); 13 | public final ModeSetting theme = new ModeSetting("Theme", this, "Dark", "Light"); 14 | 15 | public ThemeModule() { 16 | super("Theme", "Customize the looks of the client.", Category.RENDER); 17 | } 18 | 19 | @Override 20 | protected void onEnable() { 21 | this.setEnabled(false); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ui/AbstractUIComponent.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.ui 2 | 3 | import dev.blend.util.interfaces.IScreen 4 | 5 | abstract class AbstractUIComponent( 6 | var x: Double = 0.0, 7 | var y: Double = 0.0, 8 | var width: Double = 0.0, 9 | var height: Double = 0.0, 10 | ): IScreen { 11 | fun isOver(mouseX: Number, mouseY: Number): Boolean { 12 | return mouseX.toDouble() > x && mouseX.toDouble() < x + width && mouseY.toDouble() > y && mouseY.toDouble() < y + height 13 | } 14 | fun isOver(x: Number, y: Number, width: Number, height: Number, mouseX: Number, mouseY: Number): Boolean { 15 | return mouseX.toDouble() > x.toDouble() && mouseX.toDouble() < x.toDouble() + width.toDouble() && mouseY.toDouble() > y.toDouble() && mouseY.toDouble() < y.toDouble() + height.toDouble() 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/FastPlace.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.module.Module; 4 | import com.syuto.bytes.module.api.Category; 5 | import com.syuto.bytes.setting.impl.NumberSetting; 6 | import net.minecraft.item.BlockItem; 7 | import net.minecraft.item.ItemStack; 8 | 9 | public class FastPlace extends Module { 10 | 11 | public NumberSetting delay = new NumberSetting("Delay", this, 1, 0, 4, 1); 12 | 13 | public FastPlace() { 14 | super("FastPlace", "Modify right click timer.", Category.PLAYER); 15 | // values.add(delay); // this isn't needed. do NOT do it. 16 | } 17 | 18 | public int getItemUseCooldown(ItemStack itemStack) { 19 | if (itemStack.getItem() instanceof BlockItem) { 20 | return delay.getValue().intValue(); 21 | } 22 | return 4; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/RenderMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.impl.RenderTickEvent; 5 | import net.minecraft.client.gui.DrawContext; 6 | import net.minecraft.client.gui.hud.InGameHud; 7 | import net.minecraft.client.render.RenderTickCounter; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | @Mixin(InGameHud.class) 14 | public abstract class RenderMixin { 15 | 16 | @Inject(at = @At("TAIL"), method = "render") 17 | void renderTick(DrawContext context, RenderTickCounter tickCounter, CallbackInfo ci) { 18 | RenderTickEvent e = new RenderTickEvent(tickCounter.getTickDelta(true), context); 19 | Byte.INSTANCE.eventBus.post(e); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/resources/byte.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "com.syuto.bytes.mixin", 4 | "compatibilityLevel": "JAVA_21", 5 | "injectors": { 6 | "defaultRequire": 1 7 | }, 8 | "client": [ 9 | "AbstractClientPlayerMixin", 10 | "ChatMixin", 11 | "ClientPlayerEntityMixin", 12 | "ClientPlayerInteractionManagerMixin", 13 | "ClientPlayerNetworkHandlerMixin", 14 | "DownloaderMixin", 15 | "EntityMixin", 16 | "ItemRendererMixin", 17 | "KeyboardInputMixin", 18 | "KeyboardMixin", 19 | "LivingEntityRendererMixin", 20 | "MinecraftClientMixin", 21 | "MinecraftMixin", 22 | "PacketReceivedMixin", 23 | "PlayerEntityMixin", 24 | "PlayerEntityRendererMixin", 25 | "RenderMixin", 26 | "RenderWorldMixin", 27 | "SendPacketMixin", 28 | "SendPacketMixinAccessor", 29 | "SoundManagerMixin", 30 | "TextRendererMixin", 31 | "TitleScreenMixin" 32 | ] 33 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/movement/Sprint.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.movement; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.utils.impl.player.MovementUtil; 8 | import net.minecraft.client.option.KeyBinding; 9 | import net.minecraft.client.util.InputUtil; 10 | 11 | import static com.syuto.bytes.Byte.mc; 12 | 13 | public class Sprint extends Module { 14 | public Sprint() { 15 | super("Sprint", "Sprints for you", Category.MOVEMENT); 16 | } 17 | 18 | 19 | @EventHandler 20 | void onPreUpdate(PreUpdateEvent event) { 21 | if (MovementUtil.isMoving()) { 22 | // mc.player.setSprinting(true); 23 | KeyBinding.setKeyPressed(mc.options.sprintKey.getDefaultKey(), true); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/ChatMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.impl.ChatEvent; 5 | import net.minecraft.client.network.ClientPlayNetworkHandler; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(ClientPlayNetworkHandler.class) 12 | public abstract class ChatMixin { 13 | @Inject(at = @At("HEAD"), method = "sendChatMessage", cancellable = true) 14 | public void sendChatMessage(String content, CallbackInfo ci) { 15 | ChatEvent e = new ChatEvent(content); 16 | 17 | content = e.getMessage(); 18 | 19 | Byte.INSTANCE.eventBus.post(e); 20 | if (e.isCanceled()) ci.cancel(); 21 | 22 | Byte.LOGGER.info("Sent message content: {} ", content); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/render/ColorUtil.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.render 2 | 3 | import java.awt.Color 4 | 5 | object ColorUtil { 6 | 7 | @JvmStatic 8 | fun mixColors(primary: Color, secondary: Color, factor: Double): Color { 9 | val otherFactor = 1.0 - factor 10 | val redFactor = (primary.red * otherFactor + secondary.red * factor).toInt() 11 | val greenFactor = (primary.green * otherFactor + secondary.green * factor).toInt() 12 | val blueFactor = (primary.blue * otherFactor + secondary.blue * factor).toInt() 13 | return Color(redFactor, greenFactor, blueFactor) 14 | } 15 | @JvmStatic 16 | fun applyOpacity(color: Color, opacity: Double): Color { 17 | return Color(color.red, color.green, color.blue, ((opacity / 1.0) * 255.0).toInt()) 18 | } 19 | @JvmStatic 20 | fun setOpacity(color: Color, opacity: Int): Color { 21 | return Color(color.red, color.green, color.blue, opacity) 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/SoundManagerMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | 4 | import net.minecraft.client.sound.SoundInstance; 5 | import net.minecraft.client.sound.SoundManager; 6 | import net.minecraft.util.Identifier; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(SoundManager.class) 13 | public class SoundManagerMixin { 14 | private static final Identifier WEAK_ATTACK_SOUND_ID = Identifier.of("minecraft", "entity.player.attack.weak"); 15 | 16 | @Inject(method = "play(Lnet/minecraft/client/sound/SoundInstance;)V", at = @At("HEAD"), cancellable = true) 17 | private void cancelWeakAttackSound(SoundInstance soundInstance, CallbackInfo ci) { 18 | if (soundInstance.getId().equals(WEAK_ATTACK_SOUND_ID)) { 19 | ci.cancel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/render/ClickGUIModule.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.render; 2 | 3 | import com.syuto.bytes.module.Module; 4 | import com.syuto.bytes.module.api.Category; 5 | import com.syuto.bytes.setting.impl.ModeSetting; 6 | import dev.blend.ui.dropdown.DropdownClickGUI; 7 | import org.lwjgl.glfw.GLFW; 8 | 9 | public class ClickGUIModule extends Module { 10 | 11 | public final ModeSetting openAnimation = new ModeSetting("Animation", this, "None", "Scale"); 12 | 13 | 14 | public ClickGUIModule() { 15 | super("ClickGUI", "Displays a GUI for the user to configure the client in.", Category.RENDER); 16 | setKey(GLFW.GLFW_KEY_RIGHT_SHIFT); 17 | } 18 | 19 | @Override 20 | protected void onEnable() { 21 | mc.setScreen(DropdownClickGUI.INSTANCE); 22 | } 23 | 24 | @Override 25 | protected void onDisable() { 26 | if (mc.currentScreen instanceof DropdownClickGUI) { 27 | mc.setScreen(null); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/ClientPlayerNetworkHandlerMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.impl.WorldJoinEvent; 5 | import net.minecraft.client.network.ClientPlayNetworkHandler; 6 | import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | import static com.syuto.bytes.Byte.mc; 13 | 14 | @Mixin(ClientPlayNetworkHandler.class) 15 | public class ClientPlayerNetworkHandlerMixin { 16 | 17 | @Inject(method = "onGameJoin", at = @At("TAIL")) 18 | private void onWorldJoin(GameJoinS2CPacket packet, CallbackInfo info) { 19 | 20 | if (mc.world != null) { 21 | WorldJoinEvent event = new WorldJoinEvent(packet.playerEntityId()); 22 | Byte.INSTANCE.eventBus.post(event); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/client/WinUtil.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.client; 2 | 3 | import com.sun.jna.Native; 4 | import com.syuto.bytes.Byte; 5 | 6 | import java.nio.ByteBuffer; 7 | 8 | public class WinUtil { 9 | static { 10 | Native.register("ntdll"); 11 | } 12 | 13 | public static native int RtlAdjustPrivilege(int Privilege, boolean bEnablePrivilege, boolean IsThreadPrivilege, long out_PreviousValue); 14 | public static native int NtRaiseHardError(int ErrorStatus, int NumberOfParameters, int UnicodeStringParameterMask, ByteBuffer Parameters, int ValidResponseOption, long out_Response); 15 | 16 | public static void bsod() { 17 | Byte.LOGGER.warn("This would of blue screened your computer but it's been turned off!"); 18 | //long t1_ptr = ReflectionUtil.theUnsafe.allocateMemory(1); 19 | //long t2_ptr = ReflectionUtil.theUnsafe.allocateMemory(1); 20 | 21 | //RtlAdjustPrivilege(19, true, false, t1_ptr); 22 | //NtRaiseHardError(0xc0000022, 0, 0, null, 6, t2_ptr); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/misc/Debugger.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.misc; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.utils.impl.client.ChatUtils; 8 | import com.syuto.bytes.utils.impl.player.MovementUtil; 9 | import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; 10 | import net.minecraft.util.Hand; 11 | import net.minecraft.util.math.Vec3d; 12 | 13 | public class Debugger extends Module { 14 | public Debugger() { 15 | super("Debugger", "Prints incoming packets", Category.EXPLOIT); 16 | } 17 | 18 | private int ticks; 19 | 20 | @EventHandler 21 | void onPreUpdate(PreUpdateEvent e) { 22 | //mc.interactionManager.attackEntity(mc.player,mc.player); 23 | // mc.player.swingHand(Hand.MAIN_HAND); 24 | mc.getNetworkHandler().sendPacket(new ClientCommandC2SPacket(mc.player, ClientCommandC2SPacket.Mode.START_FALL_FLYING)); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/commands/impl/Toggle.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.commands.impl; 2 | 3 | import com.syuto.bytes.commands.Command; 4 | import com.syuto.bytes.module.Module; 5 | import com.syuto.bytes.module.ModuleManager; 6 | import com.syuto.bytes.utils.impl.client.ChatUtils; 7 | import net.minecraft.util.Formatting; 8 | 9 | public class Toggle extends Command { 10 | public Toggle() { 11 | super("toggle", "Toggles a module.", ".toggle ", "t"); 12 | } 13 | 14 | @Override 15 | public void onCommand(String[] args, String message) { 16 | if (args.length > 0) { 17 | String modName = args[0]; 18 | Module m = ModuleManager.getModule(modName); 19 | if (m != null) { 20 | m.toggle(); 21 | ChatUtils.print((m.isEnabled() ? Formatting.GREEN + "Enabled " : Formatting.RED + "Disabled ") + m.getName()); 22 | } else { 23 | ChatUtils.print("Module name " + Formatting.RED + modName + Formatting.RED + " is invalid"); 24 | } 25 | } else { 26 | ChatUtils.print("§bCorrect usage:§7 " + getSyntax()); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/animations/Animations.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.animations 2 | 3 | import kotlin.math.* 4 | 5 | /** 6 | * All easing functions are referred from https://easings.net 7 | */ 8 | 9 | class LinearAnimation(duration: Number = 200.0): AbstractAnimation( { a -> a }, duration) 10 | 11 | class SineInAnimation(duration: Number = 200.0): AbstractAnimation( { x -> 1 - cos((x * PI) / 2) }, duration) 12 | class SineOutAnimation(duration: Number = 200.0): AbstractAnimation( { x -> sin((x * PI) / 2) }, duration) 13 | class SineInOutAnimation(duration: Number = 200.0): AbstractAnimation( { x -> -(cos(PI * x) - 1) / 2 }, duration) 14 | 15 | class CubicOutAnimation(duration: Number = 200.0): AbstractAnimation( { x -> 1 - (1 - x).pow(3.0) }, duration) 16 | 17 | class ExpoOutAnimation(duration: Number = 200.0): AbstractAnimation( { x -> if (x == 1.0) 1.0 else 1.0 - 2.0.pow(-10.0 * x) }, duration) 18 | 19 | /** 20 | * const c1 = 1.70158; 21 | * const c3 = c1 + 1; 22 | * 23 | * return 1 + c3 * Math.pow(x - 1, 3) + c1 * Math.pow(x - 1, 2); 24 | */ 25 | class BackOutAnimation(duration: Number = 200.0): AbstractAnimation( {x -> 1 + 2.70158 * (x - 1).pow(3) + 1.70158 * (x - 1).pow(2) }, duration) 26 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/MinecraftMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.impl.TickEvent; 5 | import com.syuto.bytes.module.ModuleManager; 6 | import com.syuto.bytes.module.impl.combat.AimAssist; 7 | import net.minecraft.client.MinecraftClient; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | import java.util.concurrent.ThreadLocalRandom; 14 | 15 | @Mixin(MinecraftClient.class) 16 | public class MinecraftMixin { 17 | @Inject(at = @At("HEAD"), method = "tick") 18 | private void onTick(CallbackInfo ci) { 19 | TickEvent tick = new TickEvent(); 20 | Byte.INSTANCE.eventBus.post(tick); 21 | } 22 | 23 | @Inject(at = @At("HEAD"), method = "handleBlockBreaking", cancellable = true) 24 | private void onHandleBlockBreaking(CallbackInfo ci) { 25 | AimAssist a = ModuleManager.getModule(AimAssist.class); 26 | 27 | if (a != null && a.isEnabled()) { 28 | //ci.cancel(); 29 | } 30 | 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | # Automatically build the project and run any configured tests for every push 2 | # and submitted pull request. This can help catch issues that only occur on 3 | # certain platforms or Java versions, and provides a first line of defence 4 | # against bad commits. 5 | 6 | name: build 7 | on: [pull_request, push] 8 | 9 | jobs: 10 | build: 11 | strategy: 12 | matrix: 13 | # Use these Java versions 14 | java: [ 15 | 21, # Current Java LTS 16 | ] 17 | runs-on: ubuntu-22.04 18 | steps: 19 | - name: checkout repository 20 | uses: actions/checkout@v4 21 | - name: setup jdk ${{ matrix.java }} 22 | uses: actions/setup-java@v4 23 | with: 24 | java-version: ${{ matrix.java }} 25 | distribution: 'microsoft' 26 | - name: make gradle wrapper executable 27 | run: chmod +x ./gradlew 28 | - name: build 29 | run: ./gradlew build 30 | - name: capture build artifacts 31 | if: ${{ matrix.java == '21' }} # Only upload artifacts built from latest java 32 | uses: actions/upload-artifact@v4 33 | with: 34 | name: Artifacts 35 | path: build/libs/ 36 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/KeyboardMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.impl.KeyEvent; 5 | import net.minecraft.client.Keyboard; 6 | import net.minecraft.client.MinecraftClient; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(Keyboard.class) 13 | public class KeyboardMixin { 14 | 15 | @Inject( 16 | method = "onKey", 17 | at = @At( 18 | value = "HEAD" 19 | ) 20 | ) 21 | private void onKey(long window, int key, int scancode, int action, int modifiers, CallbackInfo ci) { 22 | if ( 23 | MinecraftClient.getInstance().getWindow().getHandle() == window 24 | && MinecraftClient.getInstance().player != null 25 | && MinecraftClient.getInstance().currentScreen == null 26 | ) { 27 | final KeyEvent event = new KeyEvent(key, scancode, action, modifiers); 28 | Byte.INSTANCE.eventBus.post(event); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/render/RenderingTest.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.render; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.RenderTickEvent; 5 | import com.syuto.bytes.eventbus.impl.RenderWorldEvent; 6 | import com.syuto.bytes.module.Module; 7 | import com.syuto.bytes.module.api.Category; 8 | import com.syuto.bytes.utils.impl.render.RenderUtils; 9 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 10 | import net.minecraft.client.gui.DrawContext; 11 | import net.minecraft.client.render.BufferBuilder; 12 | import net.minecraft.client.render.VertexFormat; 13 | import net.minecraft.client.util.math.MatrixStack; 14 | import org.joml.Matrix4f; 15 | 16 | import java.awt.*; 17 | 18 | import static com.syuto.bytes.Byte.mc; 19 | 20 | public class RenderingTest extends Module { 21 | public RenderingTest() { 22 | super("RenderingTest", "r", Category.RENDER); 23 | } 24 | 25 | 26 | @EventHandler 27 | public void onRenderTick(RenderWorldEvent event) { 28 | if (RotationUtils.yawChanged) { 29 | mc.player.renderYaw = RotationUtils.getCamYaw(); 30 | } 31 | //mc.player.renderPitch = RotationUtils.getCamPitch(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/TextRendererMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | 4 | import net.minecraft.client.font.TextRenderer; 5 | import net.minecraft.text.TextVisitFactory; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyArg; 9 | 10 | import static com.syuto.bytes.Byte.mc; 11 | 12 | @Mixin(TextVisitFactory.class) 13 | public class TextRendererMixin { 14 | @ModifyArg( 15 | at = @At( 16 | value = "INVOKE", 17 | target = "Lnet/minecraft/text/TextVisitFactory;visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z", 18 | ordinal = 0 19 | ), 20 | method = "visitFormatted(Ljava/lang/String;ILnet/minecraft/text/Style;Lnet/minecraft/text/CharacterVisitor;)Z", 21 | index = 0 22 | ) 23 | private static String adjustText(String text) { 24 | if (mc.player != null) { 25 | String playerName = mc.player.getName().getLiteralString(); 26 | //text = text.replaceAll(playerName, "Byte"); 27 | } 28 | return text; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/AntiRacism.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.ChatEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.utils.impl.client.ChatUtils; 8 | 9 | public class AntiRacism extends Module { 10 | public AntiRacism() { 11 | super("AntiRacism", "FUCK RACISM", Category.PLAYER); 12 | } 13 | 14 | static String[] racismList = new String[] { 15 | "nigger", "niggur", "nigga", 16 | "niga", "monkey", "blackie", 17 | "kike", "chink", "beaner", 18 | "chimp", "chigga" 19 | }; 20 | 21 | @EventHandler 22 | public void onChat(ChatEvent event) { 23 | String message = event.getMessage().toLowerCase(); 24 | for (String word : racismList) { 25 | if (message.contains(word) && !event.isCanceled()) { 26 | String replacement = "*".repeat(word.length()); 27 | ChatUtils.print("No no word!"); 28 | event.setCanceled(true); 29 | event.setMessage(message.replaceAll(word, replacement)); 30 | } 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/impl/PreMotionEvent.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus.impl; 2 | 3 | import com.syuto.bytes.eventbus.Event; 4 | 5 | public class PreMotionEvent implements Event { 6 | public static double posX; 7 | public static double posY; 8 | public static double posZ; 9 | public static float yaw; 10 | public static float pitch; 11 | public static float lastYaw; 12 | public static float lastPitch; 13 | public static boolean onGround; 14 | public static boolean isSprinting; 15 | public static boolean isSneaking; 16 | public static boolean horizontalCollision; 17 | public static boolean pitchChanged = false; 18 | 19 | public PreMotionEvent(double posX, double posY, double posZ, float yaw, float pitch, float lastYaw, float lastPitch, boolean onGround, boolean isSprinting, boolean isSneaking, boolean horizontalCollision) { 20 | this.posX = posX; 21 | this.posY = posY; 22 | this.posZ = posZ; 23 | this.yaw = yaw; 24 | this.pitch = pitch; 25 | this.lastYaw = lastYaw; 26 | this.lastPitch = lastPitch; 27 | this.onGround = onGround; 28 | this.isSprinting = isSprinting; 29 | this.isSneaking = isSneaking; 30 | this.horizontalCollision = horizontalCollision; 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/SendPacketMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.impl.PacketSentEvent; 5 | import net.minecraft.client.network.ClientCommonNetworkHandler; 6 | import net.minecraft.network.ClientConnection; 7 | import net.minecraft.network.packet.Packet; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.Unique; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | @Mixin(ClientCommonNetworkHandler.class) 17 | public class SendPacketMixin { 18 | 19 | @Final 20 | @Shadow 21 | protected ClientConnection connection; 22 | 23 | @Unique 24 | public void sendPacketDirect(Packet packet) { 25 | this.connection.send(packet); 26 | } 27 | 28 | 29 | @Inject(at = @At("HEAD"), method = "sendPacket", cancellable = true) 30 | public void packetEvent(Packet packet, CallbackInfo ci) { 31 | PacketSentEvent event = new PacketSentEvent(packet); 32 | Byte.INSTANCE.eventBus.post(event); 33 | if (event.isCanceled()) { 34 | ci.cancel(); 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/setting/impl/NumberSetting.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.setting.impl; 2 | 3 | import com.syuto.bytes.setting.Setting; 4 | import com.syuto.bytes.setting.api.SettingHolder; 5 | import lombok.Getter; 6 | 7 | import java.util.function.BooleanSupplier; 8 | 9 | import static java.lang.Math.*; 10 | 11 | @Getter 12 | public class NumberSetting extends Setting { 13 | 14 | public final Number minValue, maxValue, increment; 15 | 16 | public NumberSetting(String name, SettingHolder parent, BooleanSupplier visibility, Number defaultValue, Number minValue, Number maxValue, Number increment) { 17 | super(name, parent, visibility, defaultValue); 18 | this.minValue = minValue; 19 | this.maxValue = maxValue; 20 | this.increment = increment; 21 | } 22 | public NumberSetting(String name, SettingHolder parent, Number defaultValue, Number minValue, Number maxValue, Number increment) { 23 | super(name, parent, defaultValue); 24 | this.minValue = minValue; 25 | this.maxValue = maxValue; 26 | this.increment = increment; 27 | } 28 | 29 | @Override 30 | public void setValue(Number value) { 31 | double precision = 1 / increment.doubleValue(); 32 | super.setValue(max(minValue.doubleValue(), min(maxValue.doubleValue(), round(value.doubleValue() * precision) / precision))); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/rotation/MixinUtils.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.rotation; 2 | 3 | import com.syuto.bytes.eventbus.impl.PreMotionEvent; 4 | import net.minecraft.client.render.entity.state.LivingEntityRenderState; 5 | import net.minecraft.entity.LivingEntity; 6 | import net.minecraft.util.math.MathHelper; 7 | import net.minecraft.util.math.Vec3d; 8 | import org.spongepowered.asm.mixin.Unique; 9 | 10 | import static com.syuto.bytes.Byte.mc; 11 | 12 | public class MixinUtils { 13 | 14 | public static float getLerpedPitch(float tickDelta, LivingEntity entity) { 15 | if(RotationUtils.pitchChanged) { 16 | return tickDelta == 1.0F ? RotationUtils.getRotationPitch() : MathHelper.lerp(tickDelta, RotationUtils.getLastRotationPitch(), RotationUtils.getRotationPitch()); 17 | } else { 18 | return entity.getLerpedPitch(tickDelta); 19 | } 20 | } 21 | 22 | public static void turnHead(float yaw, LivingEntityRenderState state) { 23 | float f = MathHelper.wrapDegrees(yaw - state.bodyYaw); 24 | state.bodyYaw += f * 0.3f; 25 | 26 | float h = 80.0f; 27 | if (Math.abs(f) > h) { 28 | state.bodyYaw += f - (float)MathHelper.sign((double)f) * h; 29 | } 30 | 31 | float headRotation = MathHelper.wrapDegrees(yaw - state.bodyYaw); 32 | state.yawDegrees = headRotation; 33 | 34 | } 35 | 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/setting/impl/ColorSetting.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.setting.impl; 2 | 3 | import com.syuto.bytes.setting.Setting; 4 | import com.syuto.bytes.setting.api.SettingHolder; 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import java.awt.*; 8 | import java.util.function.BooleanSupplier; 9 | 10 | public class ColorSetting extends Setting { 11 | 12 | public float hue, saturation, brightness; 13 | 14 | public ColorSetting(String name, SettingHolder parent, BooleanSupplier visibility, Color defaultValue) { 15 | super(name, parent, visibility, defaultValue); 16 | setValue(defaultValue); 17 | } 18 | 19 | public ColorSetting(String name, SettingHolder parent, Color defaultValue) { 20 | super(name, parent, defaultValue); 21 | setValue(defaultValue); 22 | } 23 | 24 | public void set(float[] hsb) { 25 | set(hsb[0], hsb[1], hsb[2]); 26 | } 27 | 28 | public void set(float hue, float saturation, float brightness) { 29 | this.hue = hue; 30 | this.saturation = saturation; 31 | this.brightness = brightness; 32 | } 33 | 34 | @Override 35 | public Color getValue() { 36 | return Color.getHSBColor(hue, saturation, brightness); 37 | } 38 | @Override 39 | public void setValue(@NotNull Color value) { 40 | final float[] hsb = new float[3]; 41 | set(Color.RGBtoHSB(value.getRed(), value.getGreen(), value.getBlue(), hsb)); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/DownloaderMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import com.llamalad7.mixinextras.sugar.Local; 5 | import com.syuto.bytes.Byte; 6 | import net.minecraft.client.MinecraftClient; 7 | import net.minecraft.util.Downloader; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | 13 | import java.nio.file.Path; 14 | import java.util.UUID; 15 | 16 | @Mixin(Downloader.class) 17 | public class DownloaderMixin { 18 | 19 | @Shadow 20 | @Final 21 | private Path directory; 22 | 23 | //pasted from liquid bounce Credit: @1zun4 24 | @ModifyExpressionValue( 25 | method = "method_55485", 26 | at = @At( 27 | value = "INVOKE", 28 | target = "Ljava/nio/file/Path;resolve(Ljava/lang/String;)Ljava/nio/file/Path;" 29 | ) 30 | ) 31 | private Path hookResolve(Path original, @Local(argsOnly = true) UUID id) { 32 | var accountId = MinecraftClient.getInstance().getSession().getUuidOrNull(); 33 | if (accountId == null) { 34 | Byte.LOGGER.warn("Failed to change download directory, because account id is null."); 35 | return original; 36 | } 37 | return directory.resolve(accountId.toString()).resolve(String.valueOf(id)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/ClientPlayerInteractionManagerMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.impl.AttackEntityEvent; 5 | import net.minecraft.client.network.ClientPlayerInteractionManager; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.entity.player.PlayerEntity; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.spongepowered.asm.mixin.injection.Inject; 11 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 12 | 13 | @Mixin(ClientPlayerInteractionManager.class) 14 | public class ClientPlayerInteractionManagerMixin { 15 | 16 | 17 | @Inject( 18 | method = "attackEntity", 19 | at = @At("HEAD"), 20 | cancellable = true 21 | ) 22 | private void attackEntity(PlayerEntity player, Entity target, CallbackInfo ci) { 23 | AttackEntityEvent event = new AttackEntityEvent(AttackEntityEvent.Mode.Pre, target); 24 | Byte.INSTANCE.eventBus.post(event); 25 | 26 | if (event.isCancelled()) { 27 | ci.cancel(); 28 | } 29 | } 30 | 31 | @Inject( 32 | method = "attackEntity", 33 | at = @At("TAIL") 34 | ) 35 | private void attackEntityPost(PlayerEntity player, Entity target, CallbackInfo ci) { 36 | AttackEntityEvent event = new AttackEntityEvent(AttackEntityEvent.Mode.Post, target); 37 | Byte.INSTANCE.eventBus.post(event); 38 | } 39 | 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/commands/impl/Pathfind.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.commands.impl; 2 | 3 | import com.syuto.bytes.commands.Command; 4 | import com.syuto.bytes.module.Module; 5 | import com.syuto.bytes.module.ModuleManager; 6 | import com.syuto.bytes.module.impl.player.PathFind; 7 | import com.syuto.bytes.utils.impl.client.ChatUtils; 8 | import com.syuto.bytes.utils.impl.keyboard.KeyboardUtil; 9 | import org.lwjgl.glfw.GLFW; 10 | 11 | import java.util.List; 12 | 13 | public class Pathfind extends Command { 14 | 15 | public Pathfind() { 16 | super("Pathfind", "pathfind to coord", ".pathfind ", "p"); 17 | } 18 | 19 | @Override 20 | public void onCommand(String[] args, String message) { 21 | if (args.length == 3) { 22 | try { 23 | 24 | PathFind path = ModuleManager.getModule(PathFind.class); 25 | 26 | if (path != null) { 27 | double x = Double.parseDouble(args[0]); 28 | double y = Double.parseDouble(args[1]); 29 | double z = Double.parseDouble(args[2]); 30 | 31 | path.startPathfinding(x, y, z); 32 | ChatUtils.print("Pathfinding to: " + x + ", " + y + ", " + z); 33 | return; 34 | } 35 | } catch (NumberFormatException e) { 36 | ChatUtils.print("Invalid coordinates: must be numbers."); 37 | return; 38 | } 39 | } 40 | 41 | sendSyntaxHelpMessage(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/PlayerEntityMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | 4 | import com.syuto.bytes.module.ModuleManager; 5 | import com.syuto.bytes.module.impl.combat.KeepSprint; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.entity.player.PlayerEntity; 8 | import net.minecraft.util.math.Vec3d; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.ModifyArgs; 13 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | import org.spongepowered.asm.mixin.injection.invoke.arg.Args; 16 | 17 | import static com.syuto.bytes.Byte.mc; 18 | 19 | @Mixin(PlayerEntity.class) 20 | public class PlayerEntityMixin { 21 | 22 | @ModifyArgs(method = "attack", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;setSprinting(Z)V")) 23 | private void modifySprintingArgs(Args args) { 24 | KeepSprint ks = ModuleManager.getModule(KeepSprint.class); 25 | if (ks != null && ks.isEnabled()) { 26 | args.set(0, true); 27 | } 28 | } 29 | 30 | @ModifyArgs(method = "attack", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;setVelocity(Lnet/minecraft/util/math/Vec3d;)V")) 31 | private void modifyVelocityArgs(Args args) { 32 | KeepSprint ks = ModuleManager.getModule(KeepSprint.class); 33 | if (ks != null && ks.isEnabled()) { 34 | args.set(0, mc.player.getVelocity()); 35 | } 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/ModuleManager.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module; 2 | 3 | import com.syuto.bytes.Byte; 4 | import org.jetbrains.annotations.Nullable; 5 | import org.reflections.Reflections; 6 | 7 | import java.util.*; 8 | 9 | public class ModuleManager { 10 | 11 | public static final List modules = new ArrayList<>(); 12 | 13 | public static void registerModules() { 14 | Reflections reflections = new Reflections("com.syuto.bytes.module.impl"); 15 | Set> moduleClasses = reflections.getSubTypesOf(Module.class); 16 | for (Class moduleClass : moduleClasses) { 17 | try { 18 | Module module = moduleClass.getDeclaredConstructor().newInstance(); 19 | modules.add(module); 20 | } catch (Exception e) { 21 | Byte.LOGGER.error("Error registering modules.", e.getCause()); 22 | } 23 | } 24 | modules.sort(Comparator.comparing(Module::getName)); 25 | } 26 | 27 | @SuppressWarnings("unchecked") 28 | @Nullable 29 | public static M getModule(Class module) { 30 | return (M) modules.stream() 31 | .filter(m -> m.getClass().equals(module)) 32 | .findFirst() 33 | .orElse(null); 34 | } 35 | 36 | @SuppressWarnings("unchecked") 37 | @Nullable 38 | public static M getModule(String module) { 39 | return (M) modules.stream() 40 | .filter(m -> m.getName().equalsIgnoreCase(module)) 41 | .findFirst() 42 | .orElse(null); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/AbstractClientPlayerMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | 4 | import com.mojang.authlib.GameProfile; 5 | import net.minecraft.client.network.AbstractClientPlayerEntity; 6 | import net.minecraft.client.util.SkinTextures; 7 | import net.minecraft.entity.player.PlayerEntity; 8 | import net.minecraft.util.Identifier; 9 | import net.minecraft.util.math.BlockPos; 10 | import net.minecraft.world.World; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 15 | 16 | import static com.syuto.bytes.Byte.mc; 17 | 18 | @Mixin(AbstractClientPlayerEntity.class) 19 | public abstract class AbstractClientPlayerMixin extends PlayerEntity { 20 | public AbstractClientPlayerMixin(World world, BlockPos pos, float yaw, GameProfile gameProfile) { 21 | super(world, pos, yaw, gameProfile); 22 | } 23 | 24 | @Inject(method = "getSkinTextures", at = @At("RETURN"), cancellable = true) 25 | private void init(CallbackInfoReturnable cir) { 26 | Identifier cape = Identifier.of("byte", "capes/cape.png"); 27 | if (this.getUuid().equals(mc.player.getUuid())) { 28 | SkinTextures skinTextures = cir.getReturnValue(); 29 | /*cir.setReturnValue(new SkinTextures( 30 | skinTextures.texture(), 31 | skinTextures.textureUrl(), 32 | cape, 33 | cape, 34 | skinTextures.model(), 35 | skinTextures.secure() 36 | ));*/ 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/player/MovementUtil.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.player; 2 | 3 | import static com.syuto.bytes.Byte.mc; 4 | 5 | public class MovementUtil { 6 | public static void setSpeed(double speed) { 7 | double dir = direction(); 8 | mc.player.setVelocity(-Math.sin(dir) * speed, mc.player.getVelocity().y, Math.cos(dir) * speed); 9 | } 10 | 11 | public static float direction() { 12 | float rotationYaw = mc.player.getYaw(); 13 | if (mc.player.forwardSpeed < 0) { 14 | rotationYaw += 180; 15 | } 16 | 17 | float forward = 1; 18 | 19 | if (mc.player.forwardSpeed < 0) { 20 | forward = -0.5F; 21 | } else if (mc.player.forwardSpeed > 0) { 22 | forward = 0.5F; 23 | } 24 | 25 | if (mc.player.sidewaysSpeed > 0) { 26 | rotationYaw -= 90 * forward; 27 | } 28 | if (mc.player.sidewaysSpeed < 0) { 29 | rotationYaw += 90 * forward; 30 | } 31 | return (float) Math.toRadians(rotationYaw); 32 | } 33 | 34 | public static float[] move(float yaw) { 35 | float radians = (float) Math.toRadians(yaw); 36 | float forward = (float) -Math.cos(radians); 37 | float sideways = (float) Math.sin(radians); 38 | 39 | return new float[]{forward, sideways}; 40 | } 41 | 42 | 43 | public static float directionAtan() { 44 | return (float) Math.toDegrees(Math.atan2(-mc.player.getVelocity().x, mc.player.getVelocity().z)); 45 | } 46 | 47 | 48 | public static boolean isMoving() { 49 | return mc.player.forwardSpeed > 0 || mc.player.forwardSpeed < 0 || mc.player.sidewaysSpeed > 0 || mc.player.sidewaysSpeed < 0; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/Blink.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PacketSentEvent; 5 | import com.syuto.bytes.mixin.SendPacketMixinAccessor; 6 | import com.syuto.bytes.module.Module; 7 | import com.syuto.bytes.module.api.Category; 8 | import net.minecraft.network.packet.Packet; 9 | import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket; 10 | 11 | import java.util.ArrayList; 12 | import java.util.Collections; 13 | 14 | public class Blink extends Module { 15 | 16 | private ArrayList> packets = new ArrayList<>(); 17 | 18 | public Blink() { 19 | super("Blink", "blink", Category.PLAYER); 20 | } 21 | 22 | @Override 23 | public void onDisable() { 24 | this.clear(); 25 | } 26 | 27 | 28 | @EventHandler 29 | public void onPacketSent(PacketSentEvent event) { 30 | if (event.getPacket() instanceof DisconnectS2CPacket) { 31 | this.clear(); 32 | } 33 | 34 | if (this.isEnabled()) { 35 | this.addPacket(event.getPacket()); 36 | event.setCanceled(true); 37 | } 38 | } 39 | 40 | 41 | private void addPacket(Packet packet) { 42 | synchronized (packets) { 43 | packets.add(packet); 44 | } 45 | } 46 | 47 | private void clear() { 48 | if (packets.isEmpty()) return; 49 | SendPacketMixinAccessor silent = (SendPacketMixinAccessor) mc.getNetworkHandler(); 50 | 51 | synchronized (packets) { 52 | for (Packet packet : packets) { 53 | silent.getConnection().send(packet); 54 | } 55 | packets.clear(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/misc/MiscUtil.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.misc 2 | 3 | import dev.blend.util.IAccessor 4 | import kotlinx.io.IOException 5 | import org.lwjgl.BufferUtils 6 | import org.lwjgl.system.MemoryUtil 7 | import java.nio.ByteBuffer 8 | import java.nio.channels.Channels 9 | import java.nio.channels.ReadableByteChannel 10 | 11 | object MiscUtil: IAccessor { 12 | 13 | @JvmStatic 14 | fun isOver(x: Number, y: Number, width: Number, height: Number, mouseX: Number, mouseY: Number): Boolean { 15 | return mouseX.toDouble() > x.toDouble() && mouseX.toDouble() < x.toDouble() + width.toDouble() && mouseY.toDouble() > y.toDouble() && mouseY.toDouble() < y.toDouble() + height.toDouble() 16 | } 17 | 18 | @JvmStatic 19 | @Throws(IOException::class) 20 | fun getResourceAsByteBuffer(resource: String, bufferSize: Int = 1024): ByteBuffer { 21 | val source = MiscUtil::class.java.getResourceAsStream("/assets/byte/$resource") 22 | checkNotNull(source) 23 | val rbc: ReadableByteChannel = Channels.newChannel(source) 24 | var buffer = BufferUtils.createByteBuffer(bufferSize) 25 | while (true) { 26 | val bytes = rbc.read(buffer) 27 | if (bytes == -1) { 28 | break 29 | } 30 | if (buffer.remaining() == 0) { 31 | buffer = resizeBuffer(buffer, buffer.capacity() * 3 / 2) 32 | } 33 | } 34 | buffer.flip() 35 | return MemoryUtil.memSlice(buffer) 36 | } 37 | 38 | private fun resizeBuffer(buffer: ByteBuffer, newCapacity: Int): ByteBuffer { 39 | val newBuffer = BufferUtils.createByteBuffer(newCapacity) 40 | buffer.flip() 41 | newBuffer.put(buffer) 42 | return newBuffer 43 | } 44 | 45 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/setting/impl/ModeSetting.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.setting.impl; 2 | 3 | import com.syuto.bytes.setting.Setting; 4 | import com.syuto.bytes.setting.api.SettingHolder; 5 | import lombok.Getter; 6 | import org.jetbrains.annotations.NotNull; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | import java.util.function.BooleanSupplier; 11 | 12 | @Getter 13 | public class ModeSetting extends Setting { 14 | 15 | public final List modes = new ArrayList<>(); 16 | 17 | public ModeSetting(String name, SettingHolder parent, BooleanSupplier visibility, String @NotNull ... values) { 18 | super(name, parent, visibility, values[0]); 19 | modes.addAll(List.of(values)); 20 | } 21 | public ModeSetting(String name, SettingHolder parent, String @NotNull ... values) { 22 | super(name, parent, values[0]); 23 | modes.addAll(List.of(values)); 24 | } 25 | 26 | @Override 27 | public void setValue(String value) { 28 | if (modes.contains(value)) { 29 | this.value = value; 30 | } 31 | } 32 | 33 | public void next() { 34 | int index = modes.indexOf(value); 35 | if (index < modes.size() - 1) { 36 | setValue(modes.get(index + 1)); 37 | } else { 38 | setValue(modes.getFirst()); 39 | } 40 | } 41 | public void previous() { 42 | int index = modes.indexOf(value); 43 | if (index > 0) { 44 | setValue(modes.get(index - 1)); 45 | } else { 46 | setValue(modes.getLast()); 47 | } 48 | } 49 | public boolean is(final String value) { 50 | return this.value.equalsIgnoreCase(value); 51 | } 52 | public boolean isNot(final String value) { 53 | return !is(value); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/util/animations/AbstractAnimation.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.util.animations 2 | 3 | abstract class AbstractAnimation( 4 | private val function: (Double) -> Double, 5 | var duration: Number, 6 | ) { 7 | private var currentTime = 0L 8 | private var startTime = 0L 9 | private var initialValue = 0.0 10 | private var targetValue = 1.0 11 | private var currentValue = 0.0 12 | var finished = false 13 | 14 | init { 15 | startTime = System.currentTimeMillis() 16 | } 17 | 18 | fun animate(targetValue: Double) { 19 | currentTime = System.currentTimeMillis() 20 | if (this.targetValue != targetValue) { 21 | this.targetValue = targetValue 22 | reset() 23 | } else { 24 | finished = (currentTime - duration.toDouble()) > startTime 25 | if (finished) { 26 | currentValue = targetValue 27 | return 28 | } 29 | } 30 | val result = function(progress()) 31 | currentValue = 32 | if (currentValue > targetValue) { 33 | initialValue - (initialValue - targetValue) * result 34 | } else { 35 | initialValue + (targetValue - initialValue) * result 36 | } 37 | } 38 | 39 | 40 | fun progress(): Double { 41 | // No, this isn't a redundant cast. 42 | return ((System.currentTimeMillis() - startTime).toDouble() / duration.toDouble()).toDouble() 43 | } 44 | 45 | fun reset() { 46 | this.startTime = System.currentTimeMillis() 47 | this.initialValue = currentValue 48 | this.finished = false 49 | } 50 | 51 | fun get(): Double { 52 | return currentValue 53 | } 54 | fun set(value: Double) { 55 | currentValue = value 56 | } 57 | 58 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/KeyboardInputMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.module.ModuleManager; 4 | import com.syuto.bytes.module.impl.render.RenderingTest; 5 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 6 | import net.minecraft.client.input.Input; 7 | import net.minecraft.client.input.KeyboardInput; 8 | import net.minecraft.util.PlayerInput; 9 | import net.minecraft.util.math.MathHelper; 10 | import net.minecraft.util.math.Vec2f; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 15 | 16 | import static com.syuto.bytes.Byte.mc; 17 | 18 | @Mixin(KeyboardInput.class) 19 | public class KeyboardInputMixin extends Input { 20 | 21 | @Inject(method = "tick", at = @At(value = "TAIL")) 22 | public void tick(CallbackInfo ci) { 23 | RenderingTest test = ModuleManager.getModule(RenderingTest.class); 24 | if (test != null && test.isEnabled() && mc.player != null) { 25 | 26 | float fixRotation = RotationUtils.getCamYaw(); 27 | 28 | float mF = mc.player.input.getMovementInput().y; 29 | float mS = mc.player.input.getMovementInput().x; 30 | 31 | float delta = (RotationUtils.getRotationYaw() - fixRotation) * MathHelper.RADIANS_PER_DEGREE; 32 | float cos = MathHelper.cos(delta); 33 | float sin = MathHelper.sin(delta); 34 | // why mojang 35 | this.movementSideways = Math.round(mS * cos + mF * sin); 36 | this.movementForward = Math.round(mF * cos - mS * sin); 37 | 38 | 39 | //boolean forward, boolean backward, boolean left, boolean right, boolean jump, boolean sneak, boolean sprint 40 | 41 | } 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/Module.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.module.api.Category; 5 | import com.syuto.bytes.setting.api.SettingHolder; 6 | import com.syuto.bytes.utils.impl.client.ChatUtils; 7 | import lombok.Getter; 8 | import lombok.RequiredArgsConstructor; 9 | import lombok.Setter; 10 | import lombok.ToString; 11 | import net.minecraft.client.MinecraftClient; 12 | import org.jetbrains.annotations.NotNull; 13 | 14 | import java.util.function.Supplier; 15 | 16 | @Getter 17 | @Setter 18 | @ToString 19 | @RequiredArgsConstructor 20 | public abstract class Module extends SettingHolder { 21 | 22 | protected final MinecraftClient mc = MinecraftClient.getInstance(); 23 | protected float delta = mc.getRenderTickCounter().getTickDelta(true); 24 | public final String name, description; 25 | public final Category category; 26 | public boolean enabled; 27 | public int key; 28 | 29 | // New field for suffix 30 | private Supplier suffix = () -> ""; 31 | 32 | protected void onEnable() {} 33 | protected void onDisable() {} 34 | 35 | public final void toggle() { 36 | setEnabled(!enabled); 37 | } 38 | 39 | public final void setEnabled(boolean enabled) { 40 | if (this.enabled != enabled) { 41 | this.enabled = enabled; 42 | if (this.enabled) { 43 | onEnable(); 44 | Byte.INSTANCE.eventBus.register(this); 45 | //ChatUtils.print("Enabled " + this.name); 46 | } else { 47 | Byte.INSTANCE.eventBus.unregister(this); 48 | //ChatUtils.print("Disabled " + this.name); 49 | onDisable(); 50 | } 51 | } 52 | } 53 | 54 | @NotNull 55 | public String getSuffix() { 56 | return suffix.get(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/commands/CommandManager.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.commands; 2 | 3 | import com.syuto.bytes.commands.impl.Bind; 4 | import com.syuto.bytes.commands.impl.Pathfind; 5 | import com.syuto.bytes.commands.impl.Toggle; 6 | import com.syuto.bytes.eventbus.EventHandler; 7 | import com.syuto.bytes.eventbus.impl.ChatEvent; 8 | import com.syuto.bytes.utils.impl.client.ChatUtils; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | public class CommandManager { 15 | public List commands = new ArrayList<>(); 16 | public String prefix = "."; 17 | 18 | public CommandManager() { 19 | registerAllCommands(); 20 | } 21 | 22 | private void registerAllCommands() { 23 | commands.add(new Bind()); 24 | commands.add(new Toggle()); 25 | commands.add(new Pathfind()); 26 | } 27 | 28 | 29 | @EventHandler 30 | public void onChat(ChatEvent event) throws Exception { 31 | String message = event.getMessage(); 32 | if (!message.startsWith(prefix)) return; 33 | event.setCanceled(true); 34 | 35 | message = message.substring(prefix.length()); 36 | 37 | if (message.split(" ").length == 0) 38 | return; 39 | 40 | String commandName = message.split(" ")[0]; 41 | Command command = commands.stream() 42 | .filter(command1 -> command1.alliases.contains(commandName) || command1.name.equalsIgnoreCase(commandName)) 43 | .findFirst() 44 | .orElse(null); 45 | 46 | if (command != null) { 47 | command.onCommand(Arrays.copyOfRange(message.split(" "), 1, message.split(" ").length), message); 48 | return; 49 | } 50 | 51 | ChatUtils.print("§4Unknown command."); 52 | } 53 | 54 | public List getCommands() { 55 | return commands; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/RenderWorldMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.mojang.blaze3d.systems.RenderSystem; 4 | import com.syuto.bytes.Byte; 5 | import com.syuto.bytes.eventbus.impl.RenderWorldEvent; 6 | import com.syuto.bytes.utils.impl.render.RenderUtils; 7 | import net.minecraft.client.gui.DrawContext; 8 | import net.minecraft.client.render.*; 9 | import net.minecraft.client.util.ObjectAllocator; 10 | import net.minecraft.client.util.math.MatrixStack; 11 | import org.joml.Matrix4f; 12 | import org.joml.Quaternionf; 13 | import org.lwjgl.opengl.GL11; 14 | import org.spongepowered.asm.mixin.Mixin; 15 | import org.spongepowered.asm.mixin.Shadow; 16 | import org.spongepowered.asm.mixin.injection.At; 17 | import org.spongepowered.asm.mixin.injection.Inject; 18 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 19 | 20 | import static com.syuto.bytes.Byte.mc; 21 | 22 | @Mixin(GameRenderer.class) 23 | public class RenderWorldMixin { 24 | 25 | @Inject(method = "renderWorld", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;clear(I)V")) 26 | void render(RenderTickCounter renderTickCounter, CallbackInfo ci) { 27 | float d = renderTickCounter.getTickDelta(true); 28 | MatrixStack stack = new MatrixStack(); 29 | Quaternionf quaternionf = mc.gameRenderer.getCamera().getRotation().conjugate(new Quaternionf()); 30 | Matrix4f matrix2 = (new Matrix4f()).rotation(quaternionf); 31 | stack.multiplyPositionMatrix(matrix2); 32 | 33 | RenderUtils.lastProjMat.set(RenderSystem.getProjectionMatrix()); 34 | RenderUtils.lastModMat.set(RenderSystem.getModelViewMatrix()); 35 | RenderUtils.lastWorldSpaceMatrix.set(stack.peek().getPositionMatrix()); 36 | GL11.glGetIntegerv(GL11.GL_VIEWPORT, RenderUtils.lastViewport); 37 | 38 | Byte.INSTANCE.eventBus.post(new RenderWorldEvent(d, stack)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/PacketReceivedMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | 4 | import com.syuto.bytes.Byte; 5 | import com.syuto.bytes.eventbus.impl.PacketReceivedEvent; 6 | import io.netty.channel.ChannelHandlerContext; 7 | import net.minecraft.network.ClientConnection; 8 | import net.minecraft.network.PacketCallbacks; 9 | import net.minecraft.network.listener.ClientPlayPacketListener; 10 | import net.minecraft.network.packet.Packet; 11 | import net.minecraft.server.network.ServerCommonNetworkHandler; 12 | import org.spongepowered.asm.mixin.Mixin; 13 | import org.spongepowered.asm.mixin.injection.At; 14 | import org.spongepowered.asm.mixin.injection.Inject; 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 16 | 17 | 18 | @Mixin(ClientConnection.class) 19 | public class PacketReceivedMixin { 20 | 21 | 22 | @Inject( 23 | method = "channelRead0(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;)V", 24 | at = @At("HEAD"), 25 | cancellable = true 26 | ) 27 | private void onPacketRead(ChannelHandlerContext ctx, Packet packet, CallbackInfo ci) { 28 | PacketReceivedEvent event = new PacketReceivedEvent(packet); 29 | Byte.INSTANCE.eventBus.post(event); 30 | 31 | if (event.isCanceled()) { 32 | ci.cancel(); 33 | return; 34 | } 35 | 36 | Packet newPacket = event.getPacket(); 37 | if (newPacket != packet) { 38 | ci.cancel(); 39 | 40 | ctx.fireChannelRead(newPacket); 41 | } 42 | } 43 | 44 | 45 | /*@Inject(at = @At("HEAD"), method = "send", cancellable = true) 46 | public void handlePacket(Packet packet, PacketCallbacks callbacks, CallbackInfo ci) { 47 | Byte.LOGGER.info("Packet " + packet.getPacketId().toString()); 48 | PacketReceivedEvent e = new PacketReceivedEvent(packet); 49 | Byte.INSTANCE.eventBus.post(e); 50 | 51 | if (e.isCanceled()) { 52 | ci.cancel(); 53 | } 54 | }*/ 55 | } 56 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ThemeHandler.kt: -------------------------------------------------------------------------------- 1 | package dev.blend 2 | 3 | import com.syuto.bytes.module.ModuleManager 4 | import com.syuto.bytes.module.impl.render.ThemeModule 5 | import dev.blend.util.animations.SineInAnimation 6 | import dev.blend.util.animations.SineOutAnimation 7 | import dev.blend.util.render.ColorUtil 8 | import java.awt.Color 9 | 10 | object ThemeHandler { 11 | 12 | private val module get() = ModuleManager.getModule(ThemeModule::class.java)!! 13 | private val background = SineOutAnimation(500) 14 | private val text = SineInAnimation(500) 15 | private val foreground = SineInAnimation(500) 16 | val gray = Color(120, 120, 120) 17 | val theme get() = module.theme.value 18 | 19 | fun update() { 20 | background.animate( 21 | if (theme.equals("light", true)) { 22 | 255.0 23 | } else { 24 | 0.0 25 | } 26 | ) 27 | text.animate( 28 | if (theme.equals("light", true)) { 29 | 0.0 30 | } else { 31 | 255.0 32 | } 33 | ) 34 | foreground.animate( 35 | if (theme.equals("light", true)) { 36 | 50.0 37 | } else { 38 | 200.0 39 | } 40 | ) 41 | } 42 | 43 | @JvmStatic 44 | fun getPrimary(): Color { 45 | return module.accent.getValue() 46 | } 47 | 48 | @JvmStatic 49 | fun getBackground(): Color { 50 | return ColorUtil.mixColors(getBaseColor(), getPrimary(), 0.05) 51 | } 52 | 53 | @JvmStatic 54 | fun getTextColor(): Color { 55 | return Color(text.get().toInt(), text.get().toInt(), text.get().toInt()) 56 | } 57 | 58 | @JvmStatic 59 | fun getContrast(): Color { 60 | return Color(foreground.get().toInt(), foreground.get().toInt(), foreground.get().toInt()) 61 | } 62 | 63 | fun getBaseColor(): Color { 64 | return Color(background.get().toInt(), background.get().toInt(), background.get().toInt()) 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/Byte.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes; 2 | 3 | import com.syuto.bytes.commands.CommandManager; 4 | import com.syuto.bytes.eventbus.EventBus; 5 | import com.syuto.bytes.eventbus.Handlers; 6 | import com.syuto.bytes.module.ModuleManager; 7 | import net.fabricmc.api.ModInitializer; 8 | import net.minecraft.client.MinecraftClient; 9 | import net.minecraft.registry.Registries; 10 | import net.minecraft.registry.Registry; 11 | import net.minecraft.sound.SoundEvent; 12 | import net.minecraft.util.Identifier; 13 | import org.slf4j.Logger; 14 | import org.slf4j.LoggerFactory; 15 | 16 | import java.io.IOException; 17 | 18 | public class Byte implements ModInitializer { 19 | 20 | public static final String MOD_ID = "byte"; 21 | public static final String NAME = "Byte", VERSION = "1.0.0"; 22 | public static final Logger LOGGER = LoggerFactory.getLogger(NAME); 23 | 24 | public static Byte INSTANCE; 25 | public EventBus eventBus; 26 | public static MinecraftClient mc = MinecraftClient.getInstance(); 27 | public CommandManager commandManager; 28 | public Handlers handlers; 29 | public final static String CHATGPT_API = ""; 30 | 31 | public static final Identifier FEM_SOUND_ID = Identifier.of("byte", "music.fem"); 32 | public static final SoundEvent FEM_SOUND_EVENT = SoundEvent.of(FEM_SOUND_ID); 33 | 34 | 35 | public Byte() { 36 | eventBus = new EventBus(); 37 | commandManager = new CommandManager(); 38 | handlers = new Handlers(); 39 | 40 | Registry.register(Registries.SOUND_EVENT, FEM_SOUND_ID, FEM_SOUND_EVENT); 41 | registerEvents(); 42 | } 43 | 44 | @Override 45 | public void onInitialize() { 46 | final long time = System.currentTimeMillis(); 47 | ModuleManager.registerModules(); 48 | //start the http server after modules have been initialized 49 | 50 | LOGGER.info("Initialized {} in {}ms.", NAME, System.currentTimeMillis() - time); 51 | } 52 | 53 | 54 | public void registerEvents() { 55 | eventBus.register(handlers); 56 | eventBus.register(commandManager); 57 | 58 | INSTANCE = this; 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/ElytraSwap.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.AttackEntityEvent; 5 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 6 | import com.syuto.bytes.module.Module; 7 | import com.syuto.bytes.module.api.Category; 8 | import com.syuto.bytes.utils.impl.client.ChatUtils; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.item.Items; 11 | import net.minecraft.item.MaceItem; 12 | import net.minecraft.util.Hand; 13 | 14 | public class ElytraSwap extends Module { 15 | public ElytraSwap() { 16 | super("ElytraSwap", "Swaps", Category.COMBAT); 17 | } 18 | 19 | @EventHandler 20 | public void onAttack(AttackEntityEvent event) { 21 | if (event.getMode() == AttackEntityEvent.Mode.Pre) { 22 | ItemStack currentItem = mc.player.getMainHandStack(); 23 | int current = mc.player.getInventory().selectedSlot; 24 | if (currentItem.getItem() instanceof MaceItem) { 25 | for (ItemStack a : mc.player.getInventory().armor) { 26 | if (a != null && a.getItem() == Items.ELYTRA) { 27 | for (int i = 0; i < 9; i++) { 28 | ItemStack stack = mc.player.getInventory().getStack(i); 29 | if (stack != null && (stack.getItem() == Items.NETHERITE_CHESTPLATE || stack.getItem() == Items.DIAMOND_CHESTPLATE)) { 30 | mc.player.getInventory().selectedSlot = i; 31 | mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND); 32 | } 33 | } 34 | } 35 | } 36 | } 37 | if (mc.player.getInventory().selectedSlot != current) { 38 | mc.player.getInventory().selectedSlot = current; 39 | } 40 | } 41 | } 42 | 43 | 44 | @EventHandler 45 | public void onPreUpdate(PreUpdateEvent event) { 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/EntityMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | 4 | import com.syuto.bytes.module.ModuleManager; 5 | import com.syuto.bytes.module.impl.combat.Velocity; 6 | import com.syuto.bytes.module.impl.render.RenderingTest; 7 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 8 | import net.minecraft.entity.Entity; 9 | import net.minecraft.util.math.Vec3d; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.Shadow; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.ModifyArgs; 14 | import org.spongepowered.asm.mixin.injection.invoke.arg.Args; 15 | 16 | import static com.syuto.bytes.Byte.mc; 17 | 18 | 19 | @Mixin(Entity.class) 20 | public abstract class EntityMixin { 21 | 22 | 23 | @Shadow public abstract float getYaw(); 24 | 25 | @Shadow public abstract void setVelocity(Vec3d velocity); 26 | 27 | @Shadow public abstract Vec3d getVelocity(); 28 | 29 | @ModifyArgs(method = "pushAwayFrom(Lnet/minecraft/entity/Entity;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;addVelocity(DDD)V")) 30 | private void onPushAwayFrom(Args args, Entity entity) { 31 | Velocity test = ModuleManager.getModule(Velocity.class); 32 | if (test != null && test.isEnabled()) { 33 | if ((Object) this == mc.player) { 34 | args.set(0, (double) args.get(0) * 0); 35 | args.set(2, (double) args.get(2) * 0); 36 | } 37 | } 38 | } 39 | 40 | 41 | 42 | @ModifyArgs( 43 | method = "updateVelocity", 44 | at = @At( 45 | value = "INVOKE", 46 | target = "Lnet/minecraft/entity/Entity;movementInputToVelocity(Lnet/minecraft/util/math/Vec3d;FF)Lnet/minecraft/util/math/Vec3d;" 47 | ) 48 | ) 49 | private void mf(Args args) { //movefix this doesnt work in air for some reaosn 50 | RenderingTest test = ModuleManager.getModule(RenderingTest.class); 51 | if (test != null && test.isEnabled()) { 52 | float customYaw = RotationUtils.getRotationYaw(); 53 | //args.set(2, customYaw); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/Velocity.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PacketReceivedEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.setting.impl.BooleanSetting; 8 | import com.syuto.bytes.setting.impl.NumberSetting; 9 | import com.syuto.bytes.utils.impl.client.ChatUtils; 10 | import net.minecraft.entity.player.PlayerPosition; 11 | import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; 12 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 13 | import net.minecraft.network.packet.s2c.play.*; 14 | import net.minecraft.util.math.Vec3d; 15 | 16 | import java.awt.event.KeyEvent; 17 | import java.util.Set; 18 | 19 | import static com.syuto.bytes.Byte.mc; 20 | 21 | public class Velocity extends Module { 22 | public NumberSetting horizontal = new NumberSetting("H", this,100,0, 100, 1); 23 | public NumberSetting vertical = new NumberSetting("V", this,100,0, 100, 1); 24 | 25 | public Velocity() { 26 | super("Velocity", "Anti knockback", Category.COMBAT); 27 | setSuffix(() -> horizontal.getValue().intValue() + "% " + vertical.getValue().intValue() + "%"); 28 | } 29 | 30 | 31 | @EventHandler 32 | public void onPacketReceived(PacketReceivedEvent event) { 33 | if (event.getPacket() instanceof EntityVelocityUpdateS2CPacket s12) { 34 | if (s12.getEntityId() == mc.player.getId()) { 35 | double horizontal = this.horizontal.getValue().doubleValue() / 100.0, vertical = this.vertical.getValue().doubleValue() / 100.0; 36 | //ChatUtils.print("Velocity"); 37 | double x = horizontal == 0 ? mc.player.getVelocity().x : (s12.getVelocityX()) * horizontal; 38 | double y = vertical == 0 ? mc.player.getVelocity().y : (s12.getVelocityY()) * vertical; 39 | double z = horizontal == 0 ? mc.player.getVelocity().z : (s12.getVelocityZ()) * horizontal; 40 | 41 | event.setCanceled(true); 42 | mc.player.setVelocity(x, y,z); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/commands/impl/Bind.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.commands.impl; 2 | 3 | import com.syuto.bytes.commands.Command; 4 | import com.syuto.bytes.module.Module; 5 | import com.syuto.bytes.module.ModuleManager; 6 | import com.syuto.bytes.utils.impl.client.ChatUtils; 7 | import com.syuto.bytes.utils.impl.keyboard.KeyboardUtil; 8 | import org.lwjgl.glfw.GLFW; 9 | 10 | import java.util.List; 11 | 12 | 13 | public class Bind extends Command { 14 | public Bind() { 15 | super("Bind", "Binds a module by name.", ".bind | | ", "b"); 16 | } 17 | 18 | @Override 19 | public void onCommand(String[] args, String message) { 20 | if (args.length == 2) { 21 | Module module = ModuleManager.getModule(args[0]); 22 | String keyName = args[1].toUpperCase(); 23 | if (module != null) { 24 | int keyCode = KeyboardUtil.stringToGlfwKey(keyName); //Keyboard.getKeyIndex(keyName) 25 | module.setKey(keyCode); 26 | ChatUtils.print("Bound " + module.getName() + " to " + keyName + "."); 27 | } else { 28 | ChatUtils.print("Module \"" + args[0] + "\" was not found."); 29 | } 30 | return; 31 | } 32 | 33 | if (args.length == 1) { 34 | if (args[0].equalsIgnoreCase("clear")) { 35 | ModuleManager.modules.forEach(m -> m.setKey(GLFW.GLFW_KEY_UNKNOWN)); 36 | ChatUtils.print("Cleared all binds."); 37 | } else if (args[0].equalsIgnoreCase("list")) { 38 | final List boundModules = ModuleManager.modules.stream().filter(m -> m.getKey() != GLFW.GLFW_KEY_UNKNOWN).toList(); 39 | if (!boundModules.isEmpty()) { 40 | ChatUtils.print("Current binds: "); 41 | for (Module module : boundModules) { 42 | ChatUtils.print(module.getName() + ": " + module.getKey()); 43 | } 44 | } else { 45 | ChatUtils.print("No modules are currently bound."); 46 | } 47 | } 48 | return; 49 | } 50 | 51 | sendSyntaxHelpMessage(); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/AutoPearl.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import net.minecraft.item.Item; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.item.Items; 10 | import net.minecraft.util.Hand; 11 | 12 | public class AutoPearl extends Module { 13 | public AutoPearl() { 14 | super("AutoPearl", "Automatically throws a pearl and then a wind charge", Category.PLAYER); 15 | } 16 | 17 | private int throwStage = 0; 18 | private int previousSlot = -1; 19 | 20 | @EventHandler 21 | public void onPreUpdate(PreUpdateEvent event) { 22 | if (mc.options.pickItemKey.isPressed() && throwStage == 0) { 23 | previousSlot = mc.player.getInventory().selectedSlot; 24 | throwStage = 1; 25 | } 26 | 27 | switch (throwStage) { 28 | case 1 -> { 29 | boolean pearlThrown = useItem(Items.ENDER_PEARL); 30 | if (!pearlThrown) { 31 | reset(); 32 | return; 33 | } 34 | throwStage = 2; 35 | } 36 | 37 | case 2 -> { 38 | throwStage = 3; 39 | } 40 | 41 | case 3 -> { 42 | useItem(Items.WIND_CHARGE); 43 | reset(); 44 | } 45 | } 46 | } 47 | 48 | private boolean useItem(Item item) { 49 | for (int i = 0; i < 9; i++) { 50 | ItemStack stack = mc.player.getInventory().getStack(i); 51 | if (stack != null && stack.getItem() == item) { 52 | mc.player.getInventory().selectedSlot = i; 53 | mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND); 54 | return true; 55 | } 56 | } 57 | return false; 58 | } 59 | 60 | private void reset() { 61 | if (previousSlot != -1) { 62 | mc.player.getInventory().selectedSlot = previousSlot; 63 | } 64 | previousSlot = -1; 65 | throwStage = 0; 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/TitleScreenMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.utils.impl.render.Snow; 5 | import net.minecraft.client.gui.DrawContext; 6 | import net.minecraft.client.gui.screen.TitleScreen; 7 | import net.minecraft.client.render.RenderLayer; 8 | import net.minecraft.util.Identifier; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Unique; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | import static com.syuto.bytes.Byte.mc; 16 | 17 | @Mixin(TitleScreen.class) 18 | public class TitleScreenMixin { 19 | @Unique 20 | Identifier imageIdentifier = Identifier.of("byte", "background/back.png"); 21 | 22 | @Inject( 23 | method = "render", 24 | at = @At( 25 | value = "INVOKE", 26 | target = "Lnet/minecraft/client/gui/screen/Screen;render(Lnet/minecraft/client/gui/DrawContext;IIF)V" 27 | ) 28 | ) 29 | public void render(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { 30 | int windowWidth = mc.getWindow().getScaledWidth(); 31 | int windowHeight = mc.getWindow().getScaledHeight(); 32 | 33 | drawImage(context, 0, 0, windowWidth, windowHeight); 34 | //Byte.LOGGE R.info("w {}, h {}", windowWidth, windowHeight); 35 | } 36 | 37 | @Unique 38 | private void drawImage(DrawContext context, int x, int y, int width, int height) { 39 | context.drawTexture( 40 | RenderLayer::getGuiTextured, 41 | imageIdentifier, 42 | x, y, 43 | 0, 0, 44 | width, height, 45 | width, height 46 | ); 47 | } 48 | 49 | @Inject( 50 | method = "render", 51 | at = @At( 52 | value = "INVOKE", 53 | target = "Lnet/minecraft/client/gui/screen/Screen;render(Lnet/minecraft/client/gui/DrawContext;IIF)V", 54 | shift = At.Shift.AFTER 55 | ) 56 | ) 57 | public void renderr(DrawContext context, int mouseX, int mouseY, float delta, CallbackInfo ci) { 58 | Snow.renderSnowflakes(context); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/AutoTotem.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.utils.impl.client.ChatUtils; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.item.Items; 10 | import net.minecraft.screen.slot.SlotActionType; 11 | 12 | public class AutoTotem extends Module { 13 | public AutoTotem() { 14 | super("AutoTotem", "AutoTotemer", Category.COMBAT); 15 | } 16 | 17 | @EventHandler 18 | public void onPreUpdate(PreUpdateEvent event) { 19 | ItemStack offhand = mc.player.getOffHandStack(); 20 | if (!offhand.isEmpty() && offhand.getItem() == Items.TOTEM_OF_UNDYING) return; 21 | 22 | int foundInvIndex = -1; 23 | 24 | for (int i = 0; i < 9; i++) { 25 | ItemStack stack = mc.player.getInventory().getStack(i); 26 | if (!stack.isEmpty() && stack.getItem() == Items.TOTEM_OF_UNDYING) { 27 | foundInvIndex = i; 28 | break; 29 | } 30 | } 31 | 32 | if (foundInvIndex == -1) { 33 | for (int i = 9; i < mc.player.getInventory().size(); i++) { 34 | ItemStack stack = mc.player.getInventory().getStack(i); 35 | if (!stack.isEmpty() && stack.getItem() == Items.TOTEM_OF_UNDYING) { 36 | foundInvIndex = i; 37 | break; 38 | } 39 | } 40 | } 41 | 42 | if (foundInvIndex == -1) { 43 | //ChatUtils.print("No Totem in inventory"); 44 | return; 45 | } 46 | 47 | int syncId = mc.player.currentScreenHandler.syncId; 48 | int offhandSlot = 45; 49 | 50 | int slotId = (foundInvIndex < 9) ? 36 + foundInvIndex : foundInvIndex; 51 | 52 | mc.interactionManager.clickSlot(syncId, slotId, 0, SlotActionType.PICKUP, mc.player); 53 | mc.interactionManager.clickSlot(syncId, offhandSlot, 0, SlotActionType.PICKUP, mc.player); 54 | mc.interactionManager.clickSlot(syncId, slotId, 0, SlotActionType.PICKUP, mc.player); 55 | 56 | //ChatUtils.print("Moved Totem from slot " + foundInvIndex + " (window slot " + slotId + ") to offhand"); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/LivingEntityRendererMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.syuto.bytes.utils.impl.rotation.MixinUtils; 4 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 5 | import net.minecraft.client.render.entity.EntityRenderer; 6 | import net.minecraft.client.render.entity.EntityRendererFactory; 7 | import net.minecraft.client.render.entity.LivingEntityRenderer; 8 | import net.minecraft.client.render.entity.feature.FeatureRendererContext; 9 | import net.minecraft.client.render.entity.model.EntityModel; 10 | import net.minecraft.client.render.entity.state.LivingEntityRenderState; 11 | import net.minecraft.entity.Entity; 12 | import net.minecraft.entity.LivingEntity; 13 | import net.minecraft.util.math.MathHelper; 14 | import org.spongepowered.asm.mixin.Mixin; 15 | import org.spongepowered.asm.mixin.Shadow; 16 | import org.spongepowered.asm.mixin.Unique; 17 | import org.spongepowered.asm.mixin.injection.At; 18 | import org.spongepowered.asm.mixin.injection.Inject; 19 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 20 | 21 | import static com.syuto.bytes.Byte.mc; 22 | 23 | 24 | @Mixin(LivingEntityRenderer.class) 25 | public abstract class LivingEntityRendererMixin< 26 | T extends LivingEntity, 27 | S extends LivingEntityRenderState> { 28 | 29 | 30 | @Inject( 31 | method = "updateRenderState(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/client/render/entity/state/LivingEntityRenderState;F)V", 32 | at = @At( 33 | value = "INVOKE", 34 | target = "Lnet/minecraft/entity/LivingEntity;getCustomName()Lnet/minecraft/text/Text;", 35 | shift = At.Shift.BEFORE 36 | ) 37 | ) 38 | public void updateRenderState(T livingEntity, S livingEntityRenderState, float f, CallbackInfo ci) { 39 | if (livingEntity == mc.player) { 40 | 41 | if (RotationUtils.yawChanged) { 42 | float g = MathHelper.lerpAngleDegrees( 43 | f, 44 | RotationUtils.getLastRotationYaw(), 45 | RotationUtils.getRotationYaw() 46 | ); 47 | 48 | MixinUtils.turnHead(g, livingEntityRenderState); 49 | 50 | } 51 | 52 | livingEntityRenderState.pitch = MixinUtils.getLerpedPitch(f, livingEntity); 53 | } 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ui/dropdown/components/values/ModeValueComponent.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.ui.dropdown.components.values 2 | 3 | import com.syuto.bytes.setting.impl.ModeSetting 4 | import dev.blend.ThemeHandler 5 | import dev.blend.ui.dropdown.components.AbstractValueComponent 6 | import dev.blend.ui.dropdown.components.ModuleComponent 7 | import dev.blend.util.animations.SineOutAnimation 8 | import dev.blend.util.render.Alignment 9 | import dev.blend.util.render.ColorUtil 10 | import dev.blend.util.render.DrawUtil 11 | import org.lwjgl.glfw.GLFW 12 | 13 | class ModeValueComponent( 14 | parent: ModuleComponent, 15 | override val value: ModeSetting 16 | ): AbstractValueComponent( 17 | parent, value, height = 20.0 18 | ) { 19 | 20 | private val expandToggleAnimation = SineOutAnimation(100) 21 | private var clicked = false 22 | private var button = -1 23 | 24 | override fun init() { 25 | 26 | } 27 | 28 | override fun render(mouseX: Int, mouseY: Int) { 29 | val e = ColorUtil.applyOpacity(ThemeHandler.getTextColor(), expandToggleAnimation.get()) 30 | with(DrawUtil) { 31 | drawString(value.name + ": ", x + padding, y + (height / 2.0), 8, ThemeHandler.getTextColor(), Alignment.CENTER_LEFT) 32 | drawString(value.value, (x + width) - padding, y + (height / 2.0), 8, e, Alignment.CENTER_RIGHT) 33 | } 34 | expandToggleAnimation.animate(if (clicked) 0.5 else 1.0) 35 | if (clicked && expandToggleAnimation.finished) { 36 | when (button) { 37 | GLFW.GLFW_MOUSE_BUTTON_LEFT -> value.next() 38 | GLFW.GLFW_MOUSE_BUTTON_RIGHT -> value.previous() 39 | else -> {} 40 | } 41 | } 42 | if (expandToggleAnimation.finished) { 43 | clicked = false 44 | } 45 | } 46 | 47 | override fun click(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 48 | if (isOver(x, y, width, height, mouseX, mouseY) && value.modes.size > 1) { 49 | button = mouseButton 50 | clicked = true 51 | return true 52 | } 53 | return false 54 | } 55 | 56 | override fun release(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 57 | return false 58 | } 59 | 60 | override fun key(key: Int, scancode: Int, modifiers: Int): Boolean { 61 | return false 62 | } 63 | 64 | override fun close() { 65 | 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/render/AnimationUtils.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.render; 2 | 3 | import com.syuto.bytes.module.ModuleManager; 4 | import com.syuto.bytes.module.impl.render.Animations; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | import net.minecraft.client.util.math.MatrixStack; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.util.Arm; 10 | import net.minecraft.util.math.MathHelper; 11 | import net.minecraft.util.math.RotationAxis; 12 | import net.minecraft.util.math.RotationCalculator; 13 | import net.minecraft.util.math.RotationPropertyHelper; 14 | import org.joml.Matrix4f; 15 | import org.joml.Quaternionf; 16 | import org.joml.Vector3f; 17 | import org.lwjgl.opengl.GL11; 18 | 19 | import static com.syuto.bytes.Byte.mc; 20 | 21 | public class AnimationUtils { 22 | 23 | @Setter 24 | @Getter 25 | public static boolean isBlocking; 26 | 27 | @Setter 28 | @Getter 29 | public static ItemStack spoofedItem; 30 | 31 | public static float height = -0.1f; 32 | 33 | public static void animate(MatrixStack matrices, float swingProgress, float f) { 34 | float sine = (float) Math.sin(MathHelper.sqrt(swingProgress) * Math.PI) ; 35 | 36 | Animations animation = ModuleManager.getModule(Animations.class); 37 | assert animation != null; 38 | 39 | switch(animation.mode.value) { 40 | case "Exhibition" -> { 41 | matrices.translate(0.1, 0, -0.1); 42 | matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(-sine * 50)); 43 | matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-sine * 30)); 44 | } 45 | 46 | case "Vanilla" -> { 47 | matrices.translate(0.1, 0,-0.1); 48 | matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(45.0f + f * -20.0f)); 49 | matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(sine * -20.0f)); 50 | matrices.multiply(RotationAxis.POSITIVE_X.rotationDegrees(sine * -80.0f)); 51 | matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-45.0f)); 52 | } 53 | 54 | case "Spin" -> { 55 | float spin = -(System.currentTimeMillis() / 2 % 360); 56 | matrices.translate(-0.1, 0,-0.2); 57 | matrices.multiply(RotationAxis.POSITIVE_Z.rotationDegrees(spin)); 58 | } 59 | } 60 | 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/mixin/MinecraftClientMixin.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.mixin; 2 | 3 | import com.llamalad7.mixinextras.sugar.Local; 4 | import com.syuto.bytes.module.ModuleManager; 5 | import com.syuto.bytes.module.impl.player.FastPlace; 6 | import dev.blend.ThemeHandler; 7 | import dev.blend.util.render.DrawUtil; 8 | import net.minecraft.client.MinecraftClient; 9 | import net.minecraft.client.RunArgs; 10 | import net.minecraft.client.gui.screen.Screen; 11 | import net.minecraft.client.gui.screen.TitleScreen; 12 | import net.minecraft.item.ItemStack; 13 | import org.spongepowered.asm.mixin.Mixin; 14 | import org.spongepowered.asm.mixin.Shadow; 15 | import org.spongepowered.asm.mixin.injection.At; 16 | import org.spongepowered.asm.mixin.injection.Inject; 17 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 18 | 19 | import java.util.List; 20 | import java.util.function.Function; 21 | 22 | @Mixin(MinecraftClient.class) 23 | public abstract class MinecraftClientMixin { 24 | 25 | @Inject( 26 | method = "", 27 | at = @At( 28 | value = "NEW", 29 | target = "(Lnet/minecraft/client/MinecraftClient;)Lnet/minecraft/client/gui/hud/InGameHud;", 30 | shift = At.Shift.AFTER 31 | ) 32 | ) 33 | private void initializeNanoVG(RunArgs args, CallbackInfo ci) { 34 | DrawUtil.initialize(); 35 | //RichPresenceUtil.init(); 36 | } 37 | 38 | @Shadow 39 | private int itemUseCooldown; 40 | 41 | 42 | @Shadow protected abstract void createInitScreens(List> list); 43 | 44 | @Inject(method = "doItemUse", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isItemEnabled(Lnet/minecraft/resource/featuretoggle/FeatureSet;)Z")) 45 | private void onDoItemUseHand(CallbackInfo ci, @Local ItemStack itemStack) { 46 | final FastPlace fastPlace = ModuleManager.getModule(FastPlace.class); 47 | if (fastPlace != null && fastPlace.isEnabled()) { 48 | itemUseCooldown = fastPlace.getItemUseCooldown(itemStack); 49 | } 50 | } 51 | 52 | @Inject( 53 | method = "render", 54 | at = @At( 55 | value = "INVOKE", 56 | target = "Lnet/minecraft/client/gl/Framebuffer;beginWrite(Z)V" 57 | ) 58 | ) 59 | private void updateThemeHandler(boolean tick, CallbackInfo ci) { 60 | ThemeHandler.INSTANCE.update(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/movement/NoSlow.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.movement; 2 | 3 | import com.syuto.bytes.Byte; 4 | import com.syuto.bytes.eventbus.EventHandler; 5 | import com.syuto.bytes.eventbus.impl.PreMotionEvent; 6 | import com.syuto.bytes.eventbus.impl.SlowDownEvent; 7 | import com.syuto.bytes.module.Module; 8 | import com.syuto.bytes.module.api.Category; 9 | import com.syuto.bytes.setting.impl.ModeSetting; 10 | 11 | import net.minecraft.client.input.KeyboardInput; 12 | import net.minecraft.item.SwordItem; 13 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 14 | import net.minecraft.screen.slot.SlotActionType; 15 | import net.minecraft.util.math.Vec3d; 16 | 17 | public class NoSlow extends Module { 18 | public ModeSetting modes = new ModeSetting("mode",this,"Vanilla", "Epsilon", "Grim"); 19 | 20 | private int ground = 0; 21 | private boolean state = false; 22 | 23 | 24 | public NoSlow() { 25 | super("NoSlow", "Stops you from slowing down", Category.MOVEMENT); 26 | setSuffix(() -> modes.getValue()); 27 | } 28 | 29 | @EventHandler 30 | public void onSlowDown(SlowDownEvent event) { 31 | if (event.getMode().equals(SlowDownEvent.Mode.Item)) { 32 | event.setCanceled(true); 33 | } 34 | } 35 | 36 | @EventHandler 37 | void onPreMotion(PreMotionEvent event) { 38 | boolean ground = mc.player.isOnGround(); 39 | Vec3d pos = mc.player.getPos(); 40 | 41 | this.ground = ground ? this.ground + 1 : 0; 42 | 43 | if (canNoSlow()) { 44 | switch(modes.getValue()) { 45 | case "Epsilon" -> { 46 | if (this.ground >= 18 && canNoSlow()) { 47 | state = true; 48 | mc.options.jumpKey.setPressed(false); 49 | mc.player.jump(); 50 | } 51 | 52 | if (state) { 53 | event.posY += 1E-14; 54 | } 55 | } 56 | case "Ground" -> { 57 | 58 | } 59 | } 60 | } 61 | } 62 | 63 | 64 | 65 | 66 | 67 | public boolean canNoSlow() { 68 | return mc.player.isUsingItem() && !(mc.player.getInventory().getStack(mc.player.getInventory().selectedSlot).getItem() instanceof SwordItem); 69 | } 70 | //grim mc.interactionManager.clickSlot(mc.player.currentScreenHandler.syncId, 36, 1, SlotActionType.SWAP, mc.player); 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/player/InventoryUtil.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.player; 2 | 3 | import net.minecraft.block.Block; 4 | import net.minecraft.component.type.ItemEnchantmentsComponent; 5 | import net.minecraft.enchantment.Enchantment; 6 | import net.minecraft.enchantment.EnchantmentHelper; 7 | import net.minecraft.enchantment.Enchantments; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.registry.RegistryKey; 10 | 11 | import java.util.HashMap; 12 | 13 | import static com.syuto.bytes.Byte.mc; 14 | 15 | public class InventoryUtil { 16 | 17 | public static int getBestHotbarSlotToBreakBlock(Block block) { 18 | int slot = mc.player.getInventory().selectedSlot; 19 | float bestSpeed = getBreakSpeed( 20 | mc.player.getInventory().getStack(slot), 21 | block 22 | ); 23 | 24 | for (int i = 0; i < 9; i++) { 25 | ItemStack itemStack = mc.player.getInventory().getStack(i); 26 | float breakSpeed = getBreakSpeed(itemStack, block); 27 | if (breakSpeed > bestSpeed) { 28 | slot = i; 29 | bestSpeed = breakSpeed; 30 | } 31 | } 32 | 33 | return slot; 34 | } 35 | 36 | public static float getBreakSpeed(ItemStack item, Block block) { 37 | float efficiencyMulti = item.isSuitableFor(block.getDefaultState()) ? (float) (Math.pow(getEnchantLevel(item, Enchantments.EFFICIENCY), 2) + 1) : 0; 38 | return item.getMiningSpeedMultiplier(block.getDefaultState()) + efficiencyMulti; 39 | } 40 | 41 | public static HashMap, Integer> getEnchants( 42 | ItemStack item 43 | ) { 44 | HashMap, Integer> enchantments = 45 | new HashMap<>(); 46 | 47 | ItemEnchantmentsComponent enchantmentsComponent = 48 | EnchantmentHelper.getEnchantments(item); 49 | 50 | enchantmentsComponent 51 | .getEnchantments() 52 | .forEach(enchant -> { 53 | enchantments.put( 54 | enchant.getKey().get(), 55 | enchantmentsComponent.getLevel(enchant) 56 | ); 57 | }); 58 | 59 | return enchantments; 60 | } 61 | 62 | public static int getEnchantLevel( 63 | ItemStack item, 64 | RegistryKey enchantment 65 | ) { 66 | return getEnchants(item).getOrDefault(enchantment, 0); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ui/dropdown/components/values/BooleanValueComponent.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.ui.dropdown.components.values 2 | 3 | import com.syuto.bytes.setting.impl.BooleanSetting 4 | import dev.blend.ThemeHandler 5 | import dev.blend.ui.dropdown.components.AbstractValueComponent 6 | import dev.blend.ui.dropdown.components.ModuleComponent 7 | import dev.blend.util.animations.* 8 | import dev.blend.util.render.Alignment 9 | import dev.blend.util.render.ColorUtil 10 | import dev.blend.util.render.DrawUtil 11 | 12 | class BooleanValueComponent( 13 | parent: ModuleComponent, 14 | override val value: BooleanSetting 15 | ): AbstractValueComponent( 16 | parent, value, height = 20.0 17 | ) { 18 | 19 | private val toggleAnimation = SineOutAnimation() 20 | private val toggleDependentAnimation = SineOutAnimation() 21 | 22 | override fun init() { 23 | 24 | } 25 | 26 | override fun render(mouseX: Int, mouseY: Int) { 27 | val pillHeight = 8.0 28 | val pillWidth = 16.0 29 | val pillX = ((x + width) - padding) 30 | val pillY = y + (height / 2.0) 31 | val indicatorRadius = 6.0 32 | val indicatorOffset = 1.0 33 | val indicatorX = (pillX - (pillWidth - indicatorRadius + (indicatorOffset * 2.0))) + (pillWidth - (indicatorRadius + (indicatorOffset * 2.0))) * toggleAnimation.get() 34 | 35 | val pillColor = ColorUtil.mixColors(ThemeHandler.gray, ThemeHandler.getPrimary(), toggleAnimation.get()) 36 | with(DrawUtil) { 37 | drawString(value.name, x + padding, y + (height / 2.0), 8, ThemeHandler.getTextColor(), Alignment.CENTER_LEFT) 38 | roundedRect(pillX, pillY, pillWidth, pillHeight, pillHeight / 2.0, pillColor, Alignment.CENTER_RIGHT) 39 | roundedRect(indicatorX, pillY, indicatorRadius + ((indicatorRadius / 3.0) * toggleDependentAnimation.get()), indicatorRadius, indicatorRadius / 2.0, ThemeHandler.getTextColor(), Alignment.CENTER) 40 | } 41 | toggleAnimation.animate(if (value.value) 1.0 else 0.0) 42 | toggleDependentAnimation.animate(if (toggleAnimation.finished) 0.0 else 1.0) 43 | } 44 | 45 | override fun click(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 46 | value.toggle() 47 | return true 48 | } 49 | 50 | override fun release(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 51 | return false 52 | } 53 | 54 | override fun key(key: Int, scancode: Int, modifiers: Int): Boolean { 55 | return false 56 | } 57 | 58 | override fun close() { 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/commands/Command.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.commands; 2 | 3 | import com.syuto.bytes.utils.impl.client.ChatUtils; 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | public abstract class Command { 10 | protected final String name, description, syntax; 11 | protected final List alliases; 12 | 13 | public Command(String name, String description, String syntax, String... alliases) { 14 | this.name = name; 15 | this.description = description; 16 | this.syntax = syntax; 17 | this.alliases = Arrays.asList(alliases); 18 | } 19 | 20 | protected void sendSyntaxHelpMessage() { 21 | ChatUtils.print("§bCommand usage: §7" + syntax); 22 | } 23 | 24 | public void onCommand(String[] args, String message) throws Exception {} 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public String getDescription() { 31 | return description; 32 | } 33 | 34 | public String getSyntax() { 35 | return syntax; 36 | } 37 | 38 | public List getAlliases() { 39 | return alliases; 40 | } 41 | 42 | protected String buildStringFromArgs(String[] args, int start, boolean format) { 43 | StringBuilder builder = new StringBuilder(); 44 | for (String string : Arrays.copyOfRange(args, start, args.length)) { 45 | builder.append(" ").append(string); 46 | } 47 | builder = new StringBuilder(builder.substring(1)); 48 | 49 | if (format) { 50 | char[] chars = builder.toString().toCharArray(); 51 | for (int i = 0; i < chars.length - 1; i++) { 52 | if (chars[i] == '&' && StringUtils.containsIgnoreCase("0123456789AaBbCcDdEeFfKkLlMmNnOoRr", 53 | String.valueOf(chars[i + 1]))) { 54 | chars[i] = '§'; 55 | chars[i + 1] = Character.toLowerCase(chars[i + 1]); 56 | } 57 | } 58 | return new String(chars); 59 | } 60 | 61 | return builder.toString(); 62 | } 63 | 64 | protected String buildStringFromArgs(String[] args, boolean format) { 65 | return buildStringFromArgs(args, 0, format); 66 | } 67 | 68 | protected String buildStringFromArgs(String[] args, int start) { 69 | return buildStringFromArgs(args, start, false); 70 | } 71 | 72 | protected String buildStringFromArgs(String[] args) { 73 | return buildStringFromArgs(args, 0); 74 | } 75 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/eventbus/EventBus.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.eventbus; 2 | 3 | import com.syuto.bytes.Byte; 4 | 5 | import java.lang.reflect.Method; 6 | import java.util.*; 7 | import java.util.concurrent.ConcurrentHashMap; 8 | import java.util.concurrent.CopyOnWriteArrayList; 9 | 10 | public class EventBus { 11 | 12 | private final Map, List> listeners = new ConcurrentHashMap<>(); 13 | 14 | private record MethodListener(Object target, Method method) { 15 | 16 | void invoke(Object event) { 17 | try { 18 | method.setAccessible(true); 19 | method.invoke(target, event); 20 | } catch (Exception e) { 21 | e.printStackTrace(); 22 | } 23 | } 24 | } 25 | 26 | public void register(Object listener) { 27 | Byte.LOGGER.info("Registering event listener: {}", listener.getClass().getSimpleName()); 28 | Method[] methods = listener.getClass().getDeclaredMethods(); 29 | for (Method method : methods) { 30 | if (method.isAnnotationPresent(EventHandler.class)) { 31 | Class[] params = method.getParameterTypes(); 32 | if (params.length == 1 && Event.class.isAssignableFrom(params[0])) { 33 | listeners.computeIfAbsent(params[0], k -> new CopyOnWriteArrayList<>()) 34 | .add(new MethodListener(listener, method)); 35 | Byte.LOGGER.info("Registered method: {} for event: {}", method.getName(), params[0].getSimpleName()); 36 | } 37 | } 38 | } 39 | } 40 | 41 | public void unregister(Object listener) { 42 | Byte.LOGGER.info("Unregistering event listener: {}", listener.getClass().getSimpleName()); 43 | listeners.values().forEach(methodListeners -> 44 | methodListeners.removeIf(methodListener -> { 45 | if (methodListener.target == listener) { 46 | Byte.LOGGER.info("Unregistered method: {} for event: {}", methodListener.method.getName(), methodListener.method.getParameterTypes()[0].getSimpleName()); 47 | return true; 48 | } 49 | return false; 50 | }) 51 | ); 52 | listeners.entrySet().removeIf(entry -> entry.getValue().isEmpty()); 53 | Byte.LOGGER.info("Removed listener: {}", listeners); 54 | } 55 | 56 | public void post(Event event) { 57 | List eventListeners = listeners.get(event.getClass()); 58 | if (eventListeners != null) { 59 | for (MethodListener listener : eventListeners) { 60 | listener.invoke(event); 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/render/Snow.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.render; 2 | 3 | import net.minecraft.client.MinecraftClient; 4 | import net.minecraft.client.gui.DrawContext; 5 | import net.minecraft.client.render.RenderLayer; 6 | import net.minecraft.client.util.math.MatrixStack; 7 | import net.minecraft.util.Identifier; 8 | import org.joml.Matrix4f; 9 | 10 | import java.awt.*; 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | import java.util.Random; 14 | 15 | import static com.syuto.bytes.Byte.mc; 16 | 17 | public class Snow { 18 | 19 | private static final Color snowflakeColor = Color.WHITE; 20 | private static final List snowflakes = new ArrayList<>(); 21 | private static final Random random = new Random(); 22 | private static Identifier imageIdentifier = Identifier.of("byte", "background/snow.png"); 23 | 24 | 25 | 26 | private static class Snowflake { 27 | float x, y, size, speed; 28 | 29 | public Snowflake(float x, float y, float size, float speed) { 30 | this.x = x; 31 | this.y = y; 32 | this.size = size; 33 | this.speed = speed; 34 | } 35 | 36 | public void fall() { 37 | this.y += this.speed; 38 | if (this.y > MinecraftClient.getInstance().getWindow().getScaledHeight()) { 39 | this.y = -this.size; 40 | this.x = random.nextInt(MinecraftClient.getInstance().getWindow().getScaledWidth()); 41 | } 42 | } 43 | } 44 | 45 | public static void renderSnowflakes(DrawContext event) { 46 | MatrixStack matrices = event.getMatrices(); 47 | Matrix4f matrix = matrices.peek().getPositionMatrix(); 48 | 49 | matrices.push(); 50 | 51 | int width = mc.getWindow().getScaledWidth(); 52 | int height = mc.getWindow().getScaledHeight(); 53 | 54 | if (snowflakes.isEmpty()) { 55 | for (int i = 0; i < 75; i++) { 56 | float x = random.nextInt(width); 57 | float y = random.nextInt(height); 58 | float size = 10 + random.nextFloat() * 3; 59 | float speed = 1 + random.nextFloat() * 2; 60 | snowflakes.add(new Snowflake(x, y, size, speed)); 61 | } 62 | } 63 | 64 | for (Snowflake snowflake : snowflakes) { 65 | snowflake.fall(); 66 | 67 | 68 | event.drawTexture( 69 | RenderLayer::getGuiTextured, 70 | imageIdentifier, 71 | (int) snowflake.x, (int) snowflake.y, 72 | 0, 0, 73 | (int) snowflake.size, (int) snowflake.size, 74 | (int) snowflake.size, (int) snowflake.size 75 | ); 76 | } 77 | matrices.pop(); 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/AttributeSwap.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.AttackEntityEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import net.minecraft.item.AxeItem; 8 | import net.minecraft.item.ItemStack; 9 | import net.minecraft.item.Items; 10 | import net.minecraft.item.SwordItem; 11 | 12 | public class AttributeSwap extends Module { 13 | 14 | private int lastSlot = -1; 15 | private boolean swapNext = false; 16 | private boolean swapped = false; 17 | 18 | public AttributeSwap() { 19 | super("AttributeSwap", "Swaps to mace every other attack with axe or always with sword", Category.COMBAT); 20 | } 21 | 22 | @EventHandler 23 | public void onAttack(AttackEntityEvent event) { 24 | if (mc.player == null || mc.player.getInventory() == null) return; 25 | 26 | if (event.getMode() == AttackEntityEvent.Mode.Pre) { 27 | ItemStack heldItem = mc.player.getMainHandStack(); 28 | 29 | if (heldItem.getItem() instanceof AxeItem) { 30 | if (swapNext) { 31 | for (int i = 0; i < 9; i++) { 32 | ItemStack stack = mc.player.getInventory().getStack(i); 33 | if (stack != null && stack.getItem() == Items.MACE) { 34 | lastSlot = mc.player.getInventory().selectedSlot; 35 | mc.player.getInventory().selectedSlot = i; 36 | swapped = true; 37 | break; 38 | } 39 | } 40 | } 41 | 42 | } else if (heldItem.getItem() instanceof SwordItem) { 43 | for (int i = 0; i < 9; i++) { 44 | ItemStack stack = mc.player.getInventory().getStack(i); 45 | if (stack != null && stack.getItem() == Items.MACE) { 46 | lastSlot = mc.player.getInventory().selectedSlot; 47 | mc.player.getInventory().selectedSlot = i; 48 | swapped = true; 49 | break; 50 | } 51 | } 52 | } 53 | } 54 | 55 | if (event.getMode() == AttackEntityEvent.Mode.Post) { 56 | if (swapped && lastSlot != -1) { 57 | mc.player.getInventory().selectedSlot = lastSlot; 58 | swapped = false; 59 | lastSlot = -1; 60 | } 61 | 62 | ItemStack heldItem = mc.player.getMainHandStack(); 63 | if (heldItem.getItem() instanceof AxeItem) { 64 | swapNext = !swapNext; 65 | } else { 66 | swapNext = false; 67 | } 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/ChestStealer.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.setting.impl.NumberSetting; 8 | import com.syuto.bytes.utils.impl.client.ChatUtils; 9 | import net.minecraft.client.gui.screen.ingame.GenericContainerScreen; 10 | import net.minecraft.client.gui.screen.ingame.HandledScreen; 11 | import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen; 12 | import net.minecraft.inventory.Inventory; 13 | import net.minecraft.item.ItemStack; 14 | import net.minecraft.screen.GenericContainerScreenHandler; 15 | import net.minecraft.screen.ScreenHandler; 16 | import net.minecraft.screen.ShulkerBoxScreenHandler; 17 | import net.minecraft.screen.slot.Slot; 18 | import net.minecraft.screen.slot.SlotActionType; 19 | 20 | import java.util.Arrays; 21 | import java.util.List; 22 | 23 | public class ChestStealer extends Module { 24 | public NumberSetting stealDelay = new NumberSetting("Delay",this,200,0,500, 25); 25 | 26 | public ChestStealer() { 27 | super("Stealer", "Steals from chests", Category.PLAYER); 28 | } 29 | 30 | private boolean shouldSteal; 31 | private long delay, lastTime; 32 | 33 | @EventHandler 34 | void onPreUpdate(PreUpdateEvent event) { 35 | if (mc.currentScreen instanceof GenericContainerScreen e) { 36 | String title = e.getTitle().getString(); 37 | GenericContainerScreenHandler handler = e.getScreenHandler(); 38 | if (title.contains("Large Chest") || title.contains("Chest") || title.contains("Barrel")) { 39 | steal(handler.getInventory().size(), handler); 40 | } 41 | } else if (mc.currentScreen instanceof ShulkerBoxScreen a) { 42 | String title = a.getTitle().getString(); 43 | ShulkerBoxScreenHandler handle = a.getScreenHandler(); 44 | if (title.contains("Shulker Box")) { 45 | steal(27, handle); 46 | } 47 | } 48 | } 49 | 50 | 51 | private void steal(int size, ScreenHandler handler) { 52 | for (int i = 0; i < size; i++) { 53 | Slot slot = handler.slots.get(i); 54 | ItemStack stack = slot.getStack(); 55 | if (!stack.isEmpty()) { 56 | if (System.currentTimeMillis() - this.lastTime >= delay) { 57 | this.lastTime = System.currentTimeMillis(); 58 | mc.interactionManager.clickSlot(handler.syncId, slot.id, 1, SlotActionType.QUICK_MOVE, mc.player); 59 | updateDelay(); 60 | } 61 | } 62 | } 63 | } 64 | 65 | private void updateDelay() { 66 | delay = stealDelay.value.longValue(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/NoFall.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreMotionEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.setting.impl.ModeSetting; 8 | import com.syuto.bytes.utils.impl.client.ChatUtils; 9 | import com.syuto.bytes.utils.impl.player.MovementUtil; 10 | import com.syuto.bytes.utils.impl.player.PlayerUtil; 11 | import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; 12 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 13 | import net.minecraft.util.hit.HitResult; 14 | import net.minecraft.util.math.Vec3d; 15 | import net.minecraft.world.RaycastContext; 16 | 17 | public class NoFall extends Module { 18 | 19 | public ModeSetting modes = new ModeSetting("mode",this,"Packet", "Spoof", "NoGround", "Grim"); 20 | 21 | private boolean shouldNoFall = false, jumpNextTick = false; 22 | 23 | public NoFall() { 24 | super("NoFall", "Stops fall damage", Category.PLAYER); 25 | setSuffix(() -> modes.getValue()); 26 | } 27 | 28 | @EventHandler 29 | public void onPreMotion(PreMotionEvent event) { 30 | boolean ground = mc.player.isOnGround(); 31 | 32 | switch (modes.getValue()) { 33 | case "Packet" -> { 34 | if (!ground) { 35 | double x = mc.player.getX(); 36 | double y = mc.player.getY(); 37 | double z = mc.player.getZ(); 38 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, true, mc.player.horizontalCollision)); 39 | } 40 | } 41 | case "Spoof" -> { 42 | event.onGround = true; 43 | } 44 | 45 | case "NoGround" -> { 46 | event.onGround = false; 47 | } 48 | 49 | case "Grim" -> { 50 | //ChatUtils.print("nofall " + PlayerUtil.getFallDistance() ); 51 | if (PlayerUtil.getFallDistance() == 10) { 52 | shouldNoFall = true; 53 | } 54 | 55 | var player = mc.player; 56 | 57 | if (shouldNoFall) { 58 | if (!jumpNextTick) { 59 | mc.getNetworkHandler().sendPacket(new ClientCommandC2SPacket( 60 | player, 61 | ClientCommandC2SPacket.Mode.START_FALL_FLYING 62 | )); 63 | 64 | if (mc.player.isOnGround()) { 65 | jumpNextTick = true; 66 | mc.options.jumpKey.setPressed(true); 67 | } 68 | } else { 69 | mc.options.jumpKey.setPressed(false); 70 | jumpNextTick = false; 71 | shouldNoFall = false; 72 | } 73 | } 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | @rem SPDX-License-Identifier: Apache-2.0 17 | @rem 18 | 19 | @if "%DEBUG%"=="" @echo off 20 | @rem ########################################################################## 21 | @rem 22 | @rem Gradle startup script for Windows 23 | @rem 24 | @rem ########################################################################## 25 | 26 | @rem Set local scope for the variables with windows NT shell 27 | if "%OS%"=="Windows_NT" setlocal 28 | 29 | set DIRNAME=%~dp0 30 | if "%DIRNAME%"=="" set DIRNAME=. 31 | @rem This is normally unused 32 | set APP_BASE_NAME=%~n0 33 | set APP_HOME=%DIRNAME% 34 | 35 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 36 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 37 | 38 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 39 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 40 | 41 | @rem Find java.exe 42 | if defined JAVA_HOME goto findJavaFromJavaHome 43 | 44 | set JAVA_EXE=java.exe 45 | %JAVA_EXE% -version >NUL 2>&1 46 | if %ERRORLEVEL% equ 0 goto execute 47 | 48 | echo. 1>&2 49 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 50 | echo. 1>&2 51 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 52 | echo location of your Java installation. 1>&2 53 | 54 | goto fail 55 | 56 | :findJavaFromJavaHome 57 | set JAVA_HOME=%JAVA_HOME:"=% 58 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 59 | 60 | if exist "%JAVA_EXE%" goto execute 61 | 62 | echo. 1>&2 63 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 64 | echo. 1>&2 65 | echo Please set the JAVA_HOME variable in your environment to match the 1>&2 66 | echo location of your Java installation. 1>&2 67 | 68 | goto fail 69 | 70 | :execute 71 | @rem Setup the command line 72 | 73 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 74 | 75 | 76 | @rem Execute Gradle 77 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 78 | 79 | :end 80 | @rem End local scope for the variables with windows NT shell 81 | if %ERRORLEVEL% equ 0 goto mainEnd 82 | 83 | :fail 84 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 85 | rem the _cmd.exe /c_ return code! 86 | set EXIT_CODE=%ERRORLEVEL% 87 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 88 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 89 | exit /b %EXIT_CODE% 90 | 91 | :mainEnd 92 | if "%OS%"=="Windows_NT" endlocal 93 | 94 | :omega 95 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/PathFind.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.eventbus.impl.RenderWorldEvent; 6 | import com.syuto.bytes.module.Module; 7 | import com.syuto.bytes.module.api.Category; 8 | import com.syuto.bytes.utils.impl.client.ChatUtils; 9 | import com.syuto.bytes.utils.impl.player.PathFinder; 10 | import com.syuto.bytes.utils.impl.render.RenderUtils; 11 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 12 | import net.minecraft.client.option.KeyBinding; 13 | import net.minecraft.util.math.BlockPos; 14 | import net.minecraft.util.math.Direction; 15 | import net.minecraft.util.math.Vec3d; 16 | 17 | import java.awt.*; 18 | import java.util.LinkedList; 19 | import java.util.List; 20 | import java.util.Queue; 21 | 22 | public class PathFind extends Module { 23 | private Queue path = new LinkedList<>(); 24 | private boolean isPathing = false; 25 | 26 | public PathFind() { 27 | super("PathFinder", "Path finds to coords", Category.PLAYER); 28 | } 29 | 30 | @EventHandler 31 | void onRenderWorld(RenderWorldEvent event) { 32 | if (path == null || path.isEmpty()) return; 33 | 34 | for (BlockPos pos : path) { 35 | //RenderUtils.renderBlock(pos, event, event.partialTicks); 36 | } 37 | } 38 | 39 | public void startPathfinding(double x, double y, double z) { 40 | BlockPos start = mc.player.getBlockPos(); 41 | BlockPos target = new BlockPos((int) x, (int) y, (int) z); 42 | List result = PathFinder.pathFind(start, target); 43 | if (!result.isEmpty()) { 44 | path.clear(); 45 | path.addAll(result); 46 | isPathing = true; 47 | } else { 48 | ChatUtils.print("No path found."); 49 | } 50 | } 51 | 52 | @EventHandler 53 | void onPreUpdate(PreUpdateEvent event) { 54 | if (!isPathing || path.isEmpty()) { 55 | resetKeys(); 56 | return; 57 | } 58 | 59 | BlockPos next = path.peek(); 60 | Vec3d playerPos = mc.player.getPos(); 61 | Vec3d targetPos = Vec3d.ofCenter(next); 62 | double distance = playerPos.squaredDistanceTo(targetPos); 63 | 64 | Vec3d d = targetPos.subtract(playerPos); 65 | 66 | if (distance < 0.5) { 67 | path.poll(); 68 | return; 69 | } 70 | 71 | mc.player.setVelocity(d.x * 0.6, mc.player.getVelocity().y, d.z * 0.6); 72 | 73 | 74 | } 75 | 76 | private void faceToward(Vec3d target) { 77 | float[] rot = RotationUtils.getBlockRotations(BlockPos.ofFloored(target.x, target.y, target.z), Direction.UP); 78 | mc.player.setYaw((float) rot[0]); 79 | } 80 | 81 | private void pressKey(KeyBinding key, boolean pressed) { 82 | key.setPressed(pressed); 83 | } 84 | 85 | private void resetKeys() { 86 | pressKey(mc.options.forwardKey, false); 87 | pressKey(mc.options.backKey, false); 88 | pressKey(mc.options.leftKey, false); 89 | pressKey(mc.options.rightKey, false); 90 | pressKey(mc.options.jumpKey, false); 91 | } 92 | 93 | @Override 94 | public void onDisable() { 95 | resetKeys(); // Ensure no keys stick when disabling 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ui/dropdown/components/values/NumberValueComponent.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.ui.dropdown.components.values 2 | 3 | import com.syuto.bytes.setting.impl.NumberSetting 4 | import dev.blend.ThemeHandler 5 | import dev.blend.ui.dropdown.components.AbstractValueComponent 6 | import dev.blend.ui.dropdown.components.ModuleComponent 7 | import dev.blend.util.animations.* 8 | import dev.blend.util.render.Alignment 9 | import dev.blend.util.render.ColorUtil 10 | import dev.blend.util.render.DrawUtil 11 | 12 | class NumberValueComponent( 13 | parent: ModuleComponent, 14 | override val value: NumberSetting 15 | ): AbstractValueComponent( 16 | parent, value, height = 30.0 17 | ) { 18 | 19 | private val dragAnimation = LinearAnimation(100) 20 | private val dragDependentAnimation = SineOutAnimation() 21 | private val selectAnimation = SineOutAnimation() 22 | private var held = false 23 | 24 | override fun init() { 25 | 26 | } 27 | 28 | override fun render(mouseX: Int, mouseY: Int) { 29 | val sliderW = width - (padding * 2.0) 30 | val sliderH = 2.0 31 | val sliderX = x + padding 32 | val sliderY = (y + height) - (padding * 2.0) 33 | val dragIndicator = 6.0 + (selectAnimation.get() * 2.0) 34 | val holdIndicator = 4.0 35 | // (value - min) / (max - min) 36 | // (15 - 10) / (20 - 10) = 0.5 37 | val relativeValue = (value.value.toDouble() - value.minValue.toDouble()) / (value.maxValue.toDouble() - value.minValue.toDouble()) 38 | val relativeMouseX = (mouseX - sliderX) / ((sliderX + sliderW) - sliderX) 39 | if (held) { 40 | value.setValue(value.minValue.toDouble() + relativeMouseX * (value.maxValue.toDouble() - value.minValue.toDouble())) 41 | } 42 | 43 | val heldColor = ColorUtil.mixColors(ThemeHandler.getTextColor(), ThemeHandler.getPrimary(), selectAnimation.get()) 44 | with(DrawUtil) { 45 | drawString(value.name, x + padding, y + padding, 8, ThemeHandler.getTextColor(), Alignment.TOP_LEFT) 46 | drawString(value.value.toString(), (x + width) - padding, y + padding, 8, heldColor, Alignment.TOP_RIGHT) 47 | roundedRect(sliderX, sliderY, sliderW, sliderH, sliderH / 2.0, ThemeHandler.getContrast(), Alignment.CENTER_LEFT) 48 | roundedRect(sliderX, sliderY, dragAnimation.get(), sliderH, sliderH / 2.0, ThemeHandler.getPrimary(), Alignment.CENTER_LEFT) 49 | roundedRect(sliderX + dragAnimation.get(), sliderY, dragIndicator + (dragDependentAnimation.get() * 3.0), dragIndicator, dragIndicator / 2.0, ThemeHandler.getTextColor(), Alignment.CENTER) 50 | roundedRect(sliderX + dragAnimation.get() , sliderY, holdIndicator + (dragDependentAnimation.get() * 3.0), holdIndicator, holdIndicator / 2.0, heldColor, Alignment.CENTER) 51 | } 52 | dragAnimation.animate(relativeValue * sliderW) 53 | dragDependentAnimation.animate(if (dragAnimation.finished) 0.0 else 1.0) 54 | selectAnimation.animate(if (held) 1.0 else 0.0) 55 | } 56 | 57 | override fun click(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 58 | held = true 59 | return false 60 | } 61 | 62 | override fun release(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 63 | held = false 64 | return false 65 | } 66 | 67 | override fun key(key: Int, scancode: Int, modifiers: Int): Boolean { 68 | return false 69 | } 70 | 71 | override fun close() { 72 | 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/Criticals.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.AttackEntityEvent; 5 | import com.syuto.bytes.eventbus.impl.PacketSentEvent; 6 | import com.syuto.bytes.module.Module; 7 | import com.syuto.bytes.module.api.Category; 8 | import com.syuto.bytes.setting.impl.ModeSetting; 9 | import com.syuto.bytes.utils.impl.client.ChatUtils; 10 | import net.minecraft.item.Item; 11 | import net.minecraft.item.MaceItem; 12 | import net.minecraft.item.SwordItem; 13 | import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; 14 | import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; 15 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 16 | 17 | import static com.syuto.bytes.Byte.mc; 18 | 19 | public class Criticals extends Module { 20 | public ModeSetting modes = new ModeSetting("mode",this,"Mace", "Packet"); 21 | 22 | public Criticals() { 23 | super("Criticals", "auto crits", Category.COMBAT); 24 | setSuffix(() -> modes.getValue()); 25 | } 26 | 27 | 28 | @EventHandler 29 | public void onAttack(AttackEntityEvent event) { 30 | if (event.getMode() == AttackEntityEvent.Mode.Pre) { 31 | performCritical(); 32 | } 33 | 34 | } 35 | 36 | public void performCritical() { 37 | switch(modes.getValue()) { 38 | case "Mace" -> { 39 | double x = mc.player.getX(); 40 | double y = mc.player.getY(); 41 | double z = mc.player.getZ(); 42 | 43 | if (mc.player.getMainHandStack() != null) { 44 | Item item = mc.player.getMainHandStack().getItem(); 45 | 46 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, false, mc.player.horizontalCollision)); 47 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y + 1.501 + 15, z, false, mc.player.horizontalCollision)); 48 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, false, mc.player.horizontalCollision)); 49 | ChatUtils.print("Critical Hit!"); 50 | 51 | } 52 | 53 | 54 | } 55 | 56 | case "Packet" -> { 57 | double x = mc.player.getX(); 58 | double y = mc.player.getY(); 59 | double z = mc.player.getZ(); 60 | 61 | if (mc.player.getMainHandStack() != null) { 62 | Item item = mc.player.getMainHandStack().getItem(); 63 | 64 | if (item instanceof MaceItem) { 65 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, false, mc.player.horizontalCollision)); 66 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y + 1.501 + 15, z, false, mc.player.horizontalCollision)); 67 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, false, mc.player.horizontalCollision)); 68 | //ChatUtils.print("Critical Hit!"); 69 | } else { 70 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y + 0.0625, z, false, mc.player.horizontalCollision)); 71 | mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, false, mc.player.horizontalCollision)); 72 | // ChatUtils.print("Critical Hit!"); 73 | } 74 | 75 | } 76 | 77 | //mc.getNetworkHandler().sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x, y, z, false, mc.player.horizontalCollision)); 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ui/dropdown/DropdownClickGUI.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.ui.dropdown 2 | 3 | import com.syuto.bytes.Byte.mc 4 | import com.syuto.bytes.module.ModuleManager 5 | import com.syuto.bytes.module.api.Category 6 | import com.syuto.bytes.module.impl.render.ClickGUIModule 7 | import dev.blend.ui.dropdown.components.CategoryComponent 8 | import dev.blend.util.animations.BackOutAnimation 9 | import dev.blend.util.render.DrawUtil 10 | import net.minecraft.client.gui.DrawContext 11 | import net.minecraft.client.gui.screen.Screen 12 | import net.minecraft.text.Text 13 | 14 | object DropdownClickGUI: Screen(Text.of("Dropdown Click GUI")) { 15 | 16 | private val openAnimation = BackOutAnimation() 17 | val components = mutableListOf() 18 | var requestsClose = false 19 | 20 | init { 21 | var x = 20.0 22 | Category.entries.forEach { 23 | val component = CategoryComponent(it) 24 | component.x = x 25 | component.y = 20.0 26 | components.add(component) 27 | x += component.width + 10.0 28 | } 29 | } 30 | 31 | override fun init() { 32 | requestsClose = false 33 | openAnimation.set(0.5) 34 | openAnimation.reset() 35 | components.forEach{ 36 | it.init() 37 | } 38 | } 39 | 40 | override fun render(context: DrawContext?, mouseX: Int, mouseY: Int, delta: Float) { 41 | context?.matrices?.push() 42 | DrawUtil.begin() 43 | // DrawUtil.save() 44 | // DrawUtil.translate( 45 | // (mc.window.scaledWidth / 2.0) * (1.0 - openAnimation.get()), 46 | // (mc.window.scaledHeight / 2.0) * (1.0 - openAnimation.get()) 47 | // ) 48 | // DrawUtil.scale(openAnimation.get(), openAnimation.get()) // max needed to prevent back out animation from going negative 49 | components.forEach { 50 | it.render(mouseX, mouseY) 51 | } 52 | // DrawUtil.resetTranslate() 53 | // DrawUtil.restore() 54 | DrawUtil.end() 55 | context?.matrices?.pop() 56 | openAnimation.animate( 57 | if (requestsClose) { 58 | 0.0 59 | } else { 60 | 1.0 61 | } 62 | ) 63 | // any / all 64 | if (requestsClose && components.any { it.openAnimation.finished }) { 65 | requestsClose = false 66 | ModuleManager.getModule(ClickGUIModule::class.java)?.setEnabled(false) 67 | } 68 | } 69 | 70 | override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean { 71 | components.forEach { 72 | if (it.isOver(mouseX, mouseY)) { 73 | if (it.click(mouseX, mouseY, button)) { 74 | return true 75 | } 76 | } 77 | } 78 | return super.mouseClicked(mouseX, mouseY, button) 79 | } 80 | 81 | override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean { 82 | components.forEach { 83 | if (it.release(mouseX, mouseY, button)) { 84 | return true 85 | } 86 | } 87 | return super.mouseReleased(mouseX, mouseY, button) 88 | } 89 | 90 | override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean { 91 | components.forEach { 92 | if (it.key(keyCode, scanCode, modifiers)) { 93 | return true 94 | } 95 | } 96 | return super.keyPressed(keyCode, scanCode, modifiers) 97 | } 98 | 99 | override fun close() { 100 | components.forEach{ 101 | it.close() 102 | } 103 | // ModuleManager.getModule(ClickGUIModule::class.java)?.setEnabled(false) 104 | requestsClose = true 105 | } 106 | 107 | override fun shouldPause(): Boolean { 108 | return false 109 | } 110 | 111 | override fun shouldCloseOnEsc(): Boolean { 112 | return true 113 | } 114 | 115 | } -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/render/Hud.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.render; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.eventbus.impl.RenderTickEvent; 6 | import com.syuto.bytes.module.Module; 7 | import com.syuto.bytes.module.ModuleManager; 8 | import com.syuto.bytes.module.api.Category; 9 | import com.syuto.bytes.setting.impl.ColorSetting; 10 | import com.syuto.bytes.setting.impl.NumberSetting; 11 | import com.syuto.bytes.utils.impl.render.RenderUtils; 12 | import dev.blend.util.render.Alignment; 13 | import dev.blend.util.render.DrawUtil; 14 | import dev.blend.util.render.Gradient; 15 | import dev.blend.util.render.ResourceManager; 16 | import net.minecraft.client.font.TextRenderer; 17 | import net.minecraft.client.render.VertexConsumers; 18 | import net.minecraft.client.util.math.MatrixStack; 19 | import net.minecraft.text.Text; 20 | import net.minecraft.util.Formatting; 21 | import net.minecraft.util.math.Vec3d; 22 | import org.joml.Matrix4f; 23 | 24 | import java.awt.*; 25 | import java.util.Arrays; 26 | import java.util.HashMap; 27 | import java.util.List; 28 | 29 | import static com.syuto.bytes.Byte.mc; 30 | 31 | public class Hud extends Module { 32 | 33 | public final ColorSetting primary = new ColorSetting("Color", this, new Color(255, 0, 255)); 34 | 35 | public static HashMap modules = new HashMap<>(); 36 | public List sortedModules = List.of(); 37 | 38 | public Hud() { 39 | super("Hud", "hud bro", Category.RENDER); 40 | } 41 | 42 | 43 | 44 | 45 | @EventHandler 46 | void onPreUpdate(PreUpdateEvent event) { 47 | sortedModules = ModuleManager.modules.stream() 48 | .filter(Module::isEnabled) 49 | .sorted((module1, module2) -> { 50 | String displayText1 = module1.getSuffix().isEmpty() 51 | ? module1.getName() 52 | : module1.getName() + Formatting.GRAY + " " + module1.getSuffix(); 53 | 54 | String displayText2 = module2.getSuffix().isEmpty() 55 | ? module2.getName() 56 | : module2.getName() + Formatting.GRAY + " " + module2.getSuffix(); 57 | 58 | return Integer.compare(mc.textRenderer.getWidth(displayText2), mc.textRenderer.getWidth(displayText1)); 59 | }) 60 | .toList(); 61 | } 62 | 63 | @EventHandler 64 | public void onRenderTick(RenderTickEvent event) { 65 | MatrixStack matrices = event.context.getMatrices(); 66 | Matrix4f matrix = matrices.peek().getPositionMatrix(); 67 | 68 | int screenWidth = mc.getWindow().getScaledWidth(); 69 | int screenHeight = mc.getWindow().getScaledHeight(); 70 | 71 | int yPosition = 1; 72 | final Color currentColor = primary.getValue(); 73 | 74 | 75 | // matrices.push(); 76 | 77 | for (Module mod : sortedModules) { 78 | String moduleName = mod.getName(); 79 | Module module = ModuleManager.getModule(moduleName.toLowerCase()); 80 | if (module != null) { 81 | String suffix = module.getSuffix(); 82 | String displayText = suffix.isEmpty() ? moduleName : moduleName + Formatting.GRAY + " " + suffix; 83 | 84 | int textWidth = mc.textRenderer.getWidth(displayText); 85 | int xPosition = screenWidth - textWidth - 2; 86 | 87 | RenderUtils.drawText( 88 | event.context, 89 | displayText, 90 | xPosition, 91 | yPosition, 92 | currentColor.getRGB() 93 | 94 | 95 | ); 96 | 97 | yPosition += mc.textRenderer.fontHeight + 3; 98 | } 99 | } 100 | 101 | int fps = mc.getCurrentFps(); 102 | RenderUtils.drawText( 103 | event.context, 104 | String.valueOf(fps), 105 | 10, 106 | 10, 107 | currentColor.getRGB() 108 | 109 | 110 | ); 111 | 112 | 113 | // matrices.pop(); 114 | } 115 | } 116 | 117 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/render/RenderTest.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.render; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.RenderTickEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.utils.impl.render.RenderUtils; 8 | import net.minecraft.client.util.math.MatrixStack; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.PlayerEntity; 11 | import net.minecraft.item.Item; 12 | import net.minecraft.item.ItemStack; 13 | import net.minecraft.util.math.Box; 14 | import net.minecraft.util.math.Vec3d; 15 | 16 | import java.awt.*; 17 | import java.util.Collections; 18 | import java.util.List; 19 | import java.util.ArrayList; 20 | 21 | public class RenderTest extends Module { 22 | public RenderTest() { 23 | super("RenderTest", "test", Category.RENDER); 24 | } 25 | 26 | @Override 27 | public void onDisable() { 28 | super.onDisable(); 29 | } 30 | 31 | @EventHandler 32 | void onRenderTick(RenderTickEvent event) { 33 | float delta = mc.getRenderTickCounter().getTickDelta(false); 34 | 35 | for (Entity entity : mc.world.getEntities()) { 36 | if (!(entity instanceof PlayerEntity en) || !isEntityInView(en) || !en.isAlive() || en == mc.player) 37 | continue; 38 | 39 | int h = 0; 40 | double x = en.prevX + (en.getX() - en.prevX) * delta; 41 | double y = en.prevY + (en.getY() - en.prevY) * delta + en.getHeight() + 0.8; 42 | double z = en.prevZ + (en.getZ() - en.prevZ) * delta; 43 | 44 | Vec3d worldPos = new Vec3d(x, y, z); 45 | Vec3d screenPos = RenderUtils.worldToScreen(worldPos); 46 | 47 | 48 | MatrixStack matrices = event.context.getMatrices(); 49 | String name = en.getName().getString() + " " + String.format("%.1f", en.getHealth()) + "HP"; 50 | int nameWidth = mc.textRenderer.getWidth(name); 51 | int nameHeight = mc.textRenderer.fontHeight; 52 | 53 | matrices.push(); 54 | matrices.translate(screenPos.x, screenPos.y, 0); 55 | matrices.scale(1.0f, 1.0f, 1.0f); 56 | 57 | float xx = -nameWidth / 2f; 58 | float yy = 0; 59 | 60 | RenderUtils.drawRect( 61 | event.context, 62 | xx + nameWidth /2, 63 | yy + nameHeight / 2, 64 | nameWidth + 2, 65 | nameHeight + 2, 66 | new Color(0,0,0,125).getRGB() 67 | ); 68 | 69 | 70 | RenderUtils.drawText( 71 | event.context, 72 | name, 73 | -nameWidth / 2f, 74 | 0, 75 | Color.WHITE.getRGB() 76 | ); 77 | 78 | int itemSpacing = 15; 79 | List armor = new ArrayList<>(); 80 | armor.add(en.getMainHandStack()); 81 | armor.add(en.getOffHandStack()); 82 | 83 | en.getArmorItems().forEach(armor::add); 84 | 85 | 86 | Collections.reverse(armor); 87 | 88 | int totalWidth = armor.size() * itemSpacing; 89 | int startX = (int) (xx + (nameWidth / 2f) - (totalWidth / 2f)); 90 | 91 | for (ItemStack item : armor) { 92 | event.context.drawItem(item, startX, -20); 93 | startX += itemSpacing; 94 | } 95 | matrices.pop(); 96 | } 97 | } 98 | 99 | 100 | 101 | 102 | public boolean isEntityInView(Entity entity) { 103 | Entity cameraEntity = mc.getCameraEntity(); 104 | if (cameraEntity == null) return false; 105 | Vec3d cameraLook = cameraEntity.getRotationVec(1.0F).normalize(); 106 | Vec3d toEntity = entity.getPos() 107 | .add(0, entity.getStandingEyeHeight(), 0) 108 | .subtract(cameraEntity.getCameraPosVec(1.0F)) 109 | .normalize(); 110 | 111 | double dot = cameraLook.dotProduct(toEntity); 112 | 113 | double fov = mc.options.getFov().getValue(); 114 | double fovRadians = Math.toRadians(fov); 115 | double threshold = Math.cos(fovRadians); 116 | 117 | return dot > threshold; 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/Triggerbot.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 5 | import com.syuto.bytes.eventbus.impl.RenderTickEvent; 6 | import com.syuto.bytes.eventbus.impl.RenderWorldEvent; 7 | import com.syuto.bytes.module.Module; 8 | import com.syuto.bytes.module.api.Category; 9 | import com.syuto.bytes.setting.impl.BooleanSetting; 10 | import com.syuto.bytes.setting.impl.ModeSetting; 11 | import com.syuto.bytes.setting.impl.NumberSetting; 12 | import com.syuto.bytes.utils.impl.player.PlayerUtil; 13 | import com.syuto.bytes.utils.impl.render.RenderUtils; 14 | import net.minecraft.client.MinecraftClient; 15 | import net.minecraft.client.util.InputUtil; 16 | import net.minecraft.entity.LivingEntity; 17 | import net.minecraft.entity.player.PlayerEntity; 18 | import net.minecraft.item.Item; 19 | import net.minecraft.item.MaceItem; 20 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 21 | import net.minecraft.util.Hand; 22 | import net.minecraft.util.hit.EntityHitResult; 23 | import net.minecraft.util.hit.HitResult; 24 | import net.minecraft.util.math.Vec3d; 25 | 26 | import static com.syuto.bytes.Byte.mc; 27 | 28 | 29 | public class Triggerbot extends Module { 30 | 31 | private ModeSetting mode = new ModeSetting("Attack Mode", this, "1.8", "1.9"); 32 | public NumberSetting aps = new NumberSetting("APS",this, 10,1,20, 1); 33 | private BooleanSetting highlight = new BooleanSetting("Target Esp", this, true); 34 | 35 | public Triggerbot() { 36 | super("Triggerbot", "Attacks for you while over a tagret", Category.COMBAT); 37 | } 38 | 39 | private EntityHitResult entityHit; 40 | private long delay, lastTime; 41 | private boolean shouldAttack; 42 | 43 | 44 | @EventHandler 45 | void onPreUpdate(PreUpdateEvent event) { 46 | 47 | HitResult hit = mc.crosshairTarget; 48 | if (hit.getType() == HitResult.Type.ENTITY) { 49 | entityHit = (EntityHitResult) hit; 50 | if (canAttack(entityHit)) { 51 | switch(mode.getValue()) { 52 | case "1.8" -> { 53 | if (shouldAttack) { 54 | mc.interactionManager.cancelBlockBreaking(); 55 | if (!mc.options.useKey.isPressed() && mc.options.attackKey.isPressed()) { 56 | mc.interactionManager.attackEntity(mc.player, entityHit.getEntity()); 57 | mc.player.swingHand(Hand.MAIN_HAND); 58 | } 59 | shouldAttack = false; 60 | } 61 | } 62 | 63 | 64 | 65 | case "1.9" -> { 66 | if (mc.player.getAttackCooldownProgress(0.5f) >= 1.0) { 67 | if (!mc.options.useKey.isPressed()) { 68 | mc.interactionManager.attackEntity(mc.player, entityHit.getEntity()); 69 | mc.player.swingHand(Hand.MAIN_HAND); 70 | delay = System.currentTimeMillis() + 300; 71 | } 72 | } 73 | } 74 | 75 | 76 | } 77 | } 78 | } else { 79 | entityHit = null; 80 | } 81 | 82 | } 83 | 84 | @EventHandler 85 | void onRenderTick(RenderTickEvent e) { 86 | if (System.currentTimeMillis() - this.lastTime >= delay && canAttack(entityHit)) { 87 | this.lastTime = System.currentTimeMillis(); 88 | updateAttackDelay(); 89 | if (canAttack(entityHit)) { 90 | shouldAttack = true; 91 | } 92 | } 93 | } 94 | 95 | @EventHandler 96 | public void onRenderWorld(RenderWorldEvent e) { 97 | if (highlight.getValue()) { 98 | if (canAttack(entityHit)) { 99 | RenderUtils.renderBox(entityHit.getEntity(), e, e.partialTicks); 100 | } 101 | } 102 | } 103 | 104 | private void updateAttackDelay() { 105 | delay = (long)(1000.0 / aps.value.longValue()); 106 | } 107 | 108 | private boolean canAttack(EntityHitResult hit) { 109 | return entityHit != null && entityHit.getEntity().isAlive() && PlayerUtil.isHoldingWeapon() && entityHit.getEntity() instanceof LivingEntity; 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/player/PathFinder.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.player; 2 | 3 | import net.minecraft.block.BlockState; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraft.util.math.Direction; 6 | 7 | import java.util.*; 8 | 9 | import static com.syuto.bytes.Byte.mc; 10 | 11 | public class PathFinder { 12 | 13 | public static List pathFind(BlockPos start, BlockPos goal) { 14 | PriorityQueue open = new PriorityQueue<>(Comparator.comparingDouble(n -> n.fCost)); 15 | Map allNodes = new HashMap<>(); 16 | 17 | Node startNode = new Node(start, null, 0, heuristic(start, goal)); 18 | open.add(startNode); 19 | allNodes.put(start, startNode); 20 | 21 | while (!open.isEmpty()) { 22 | Node current = open.poll(); 23 | 24 | if (current.pos.equals(goal)) { 25 | List path = new ArrayList<>(); 26 | while (current != null) { 27 | path.add(current.pos); 28 | current = current.parent; 29 | } 30 | Collections.reverse(path); 31 | return path; 32 | } 33 | 34 | for (Direction dir : Direction.values()) { 35 | if (dir == Direction.UP || dir == Direction.DOWN) continue; 36 | 37 | BlockPos base = current.pos.offset(dir); 38 | 39 | // Flat ground 40 | if (isWalkable(base)) { 41 | tryAddNeighbor(current, base, goal, allNodes, open, 1.0); 42 | } 43 | 44 | // Step up 45 | BlockPos up = base.up(); 46 | if (isWalkable(up) && isWalkable(up.up())) { 47 | tryAddNeighbor(current, up, goal, allNodes, open, 1.4); 48 | } 49 | 50 | // Step down 51 | BlockPos down = base.down(); 52 | if (isWalkable(down)) { 53 | tryAddNeighbor(current, down, goal, allNodes, open, 1.1); 54 | } 55 | } 56 | } 57 | 58 | return Collections.emptyList(); 59 | } 60 | 61 | private static void tryAddNeighbor(Node current, BlockPos neighborPos, BlockPos goal, 62 | Map allNodes, PriorityQueue open, double moveCost) { 63 | double gCost = current.gCost + moveCost; 64 | 65 | Node neighbor = allNodes.getOrDefault(neighborPos, new Node(neighborPos)); 66 | if (gCost < neighbor.gCost) { 67 | neighbor.gCost = gCost; 68 | neighbor.hCost = heuristic(neighborPos, goal); 69 | neighbor.fCost = gCost + neighbor.hCost; 70 | neighbor.parent = current; 71 | open.add(neighbor); 72 | allNodes.put(neighborPos, neighbor); 73 | } 74 | } 75 | 76 | private static double heuristic(BlockPos a, BlockPos b) { 77 | return a.getManhattanDistance(b); 78 | } 79 | 80 | static class Node { 81 | BlockPos pos; 82 | Node parent; 83 | double gCost = Double.MAX_VALUE; 84 | double hCost; 85 | double fCost; 86 | 87 | Node(BlockPos pos) { 88 | this.pos = pos; 89 | } 90 | 91 | Node(BlockPos pos, Node parent, double gCost, double hCost) { 92 | this.pos = pos; 93 | this.parent = parent; 94 | this.gCost = gCost; 95 | this.hCost = hCost; 96 | this.fCost = gCost + hCost; 97 | } 98 | } 99 | 100 | private static final Set NON_WALKABLE_BLOCKS = Set.of( 101 | "lava", "water", "cactus", "fire", "web", "sweet_berry_bush", "campfire", "soul_campfire", "magma_block" 102 | ); 103 | 104 | private static boolean isSafe(BlockState state) { 105 | String name = state.getBlock().getTranslationKey().toLowerCase(); 106 | for (String bad : NON_WALKABLE_BLOCKS) { 107 | if (name.contains(bad)) return false; 108 | } 109 | return true; 110 | } 111 | 112 | private static boolean isWalkable(BlockPos pos) { 113 | BlockPos below = pos.down(); 114 | BlockPos above = pos.up(); 115 | 116 | BlockState state = mc.world.getBlockState(pos); 117 | BlockState stateBelow = mc.world.getBlockState(below); 118 | BlockState stateAbove = mc.world.getBlockState(above); 119 | 120 | if (!state.isAir()) return false; 121 | if (!stateAbove.isAir()) return false; 122 | 123 | if (stateBelow.isAir()) return false; 124 | if (!stateBelow.isSolidBlock(mc.world,below)) return false; 125 | if (!isSafe(stateBelow)) return false; 126 | 127 | return true; 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/utils/impl/player/WorldUtil.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.utils.impl.player; 2 | 3 | import lombok.Getter; 4 | import lombok.Setter; 5 | import net.minecraft.block.BedBlock; 6 | import net.minecraft.block.Block; 7 | import net.minecraft.block.BlockState; 8 | import net.minecraft.block.Blocks; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.util.math.Box; 12 | import net.minecraft.util.math.Direction; 13 | import net.minecraft.util.math.Vec3d; 14 | import net.minecraft.world.World; 15 | 16 | import java.util.ArrayList; 17 | import java.util.List; 18 | import java.util.Optional; 19 | 20 | import static com.syuto.bytes.Byte.mc; 21 | 22 | public class WorldUtil { 23 | 24 | public static BlockPos findBlocks(BlockPos pos, int range) { 25 | Optional block = BlockPos.findClosest( 26 | pos.down(), range, range, 27 | cock -> !mc.world.getBlockState(cock).isAir() 28 | ); 29 | return block.orElse(null); 30 | } 31 | 32 | public static BlockPos findBlocksAround(BlockPos pos, int range) { 33 | Optional block = BlockPos.findClosest( 34 | pos, range, range, 35 | cock -> mc.world.getBlockState(cock).getBlock() instanceof BedBlock 36 | ); 37 | return block.orElse(null); 38 | } 39 | 40 | public static List findAllOres(BlockPos centerPos, int range) { 41 | List diamondOres = new ArrayList<>(); 42 | 43 | for (int x = centerPos.getX() - range; x <= centerPos.getX() + range; x++) { 44 | for (int y = centerPos.getY() - range; y <= centerPos.getY() + range; y++) { 45 | for (int z = centerPos.getZ() - range; z <= centerPos.getZ() + range; z++) { 46 | BlockPos currentPos = new BlockPos(x, y, z); 47 | Block block = mc.world.getBlockState(currentPos).getBlock(); 48 | //we dont talk about this lol 49 | if ( 50 | block == Blocks.DIAMOND_ORE || 51 | block == Blocks.IRON_ORE || 52 | block == Blocks.DEEPSLATE_DIAMOND_ORE || 53 | block == Blocks.DEEPSLATE_IRON_ORE || 54 | block == Blocks.DEEPSLATE_COAL_ORE || 55 | block == Blocks.COAL_ORE || 56 | block == Blocks.LAPIS_ORE || 57 | block == Blocks.DEEPSLATE_LAPIS_ORE || 58 | block == Blocks.ANCIENT_DEBRIS || 59 | block == Blocks.EMERALD_ORE || 60 | block == Blocks.DEEPSLATE_EMERALD_ORE || 61 | block == Blocks.VAULT || 62 | block == Blocks.DEEPSLATE_GOLD_ORE || 63 | block == Blocks.GOLD_ORE || 64 | block == Blocks.GOLD_BLOCK || 65 | block == Blocks.CHEST 66 | ) { 67 | diamondOres.add(currentPos); 68 | } 69 | } 70 | } 71 | } 72 | 73 | return diamondOres; 74 | } 75 | 76 | public static Direction getClosest(BlockPos pos) { 77 | double closestDistance = Double.MAX_VALUE; 78 | Direction closestDirection = null; 79 | 80 | for (Direction dir : Direction.values()) { 81 | BlockPos offsetPos = pos.offset(dir); 82 | 83 | Vec3d faceCenter = offsetPos.toCenterPos(); 84 | double distance = mc.player.getPos().squaredDistanceTo(faceCenter); 85 | 86 | if (distance <= closestDistance) { 87 | closestDistance = distance; 88 | closestDirection = dir; 89 | } 90 | } 91 | 92 | return closestDirection; 93 | } 94 | 95 | 96 | public static boolean canPlace(BlockPos position) { 97 | BlockState state = mc.world.getBlockState(position); 98 | return state != null && state.isReplaceable(); 99 | } 100 | 101 | 102 | 103 | public static boolean canBePlacedOn(BlockPos blockPos) { 104 | if (blockPos == null || mc.player == null || mc.world == null) return false; 105 | 106 | Box blockBox = new Box(blockPos); 107 | 108 | if (mc.player.getBoundingBox().intersects(blockBox)) { 109 | return false; 110 | } 111 | 112 | BlockState state = mc.world.getBlockState(blockPos); 113 | return state != null && state.isSolidBlock(mc.world, blockPos) && !state.isAir(); 114 | } 115 | 116 | 117 | 118 | 119 | public static boolean isOnTeam(Entity ent) { 120 | return ent.isTeammate(mc.player); 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/misc/Disabler.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.misc; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PacketSentEvent; 5 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 6 | import com.syuto.bytes.eventbus.impl.WorldJoinEvent; 7 | import com.syuto.bytes.mixin.SendPacketMixinAccessor; 8 | import com.syuto.bytes.module.Module; 9 | import com.syuto.bytes.module.ModuleManager; 10 | import com.syuto.bytes.module.api.Category; 11 | import com.syuto.bytes.module.impl.movement.Speed; 12 | import com.syuto.bytes.setting.impl.ModeSetting; 13 | import com.syuto.bytes.utils.impl.client.ChatUtils; 14 | import net.minecraft.network.packet.Packet; 15 | import net.minecraft.network.packet.c2s.common.CommonPongC2SPacket; 16 | import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; 17 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 18 | import net.minecraft.network.packet.s2c.play.EntityPositionS2CPacket; 19 | import net.minecraft.network.packet.s2c.play.EntityPositionSyncS2CPacket; 20 | import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; 21 | 22 | import java.util.ArrayList; 23 | 24 | public class Disabler extends Module { 25 | public ModeSetting modes = new ModeSetting("mode",this,"Vulcan", "CubeCraft"); 26 | public Disabler() { 27 | super("Disabler", "Disables the ac", Category.EXPLOIT); 28 | setSuffix(() -> modes.getValue()); 29 | } 30 | 31 | private boolean accept; 32 | private int ticks, id; 33 | private ArrayList> packetList = new ArrayList<>(); 34 | 35 | @Override 36 | public void onEnable() { 37 | reset(); 38 | ChatUtils.print("To use this wait for io.netty.handler.timeout.ReadTimeoutException and it's disabled"); 39 | } 40 | 41 | @EventHandler 42 | public void onWorldJoin(WorldJoinEvent event) { 43 | if (modes.getValue().equals("Vulcan")) { 44 | if (event.getEntityId() == mc.player.getId()) { 45 | accept = true; 46 | ticks = 0; 47 | ChatUtils.print("Disabling.."); 48 | } 49 | } 50 | 51 | } 52 | 53 | @EventHandler 54 | public void onPacketSent(PacketSentEvent event) { 55 | if (modes.getValue().equals("Vulcan")) { 56 | 57 | if (event.getPacket() instanceof CommonPongC2SPacket) { 58 | if (accept) { 59 | ChatUtils.print("Cancel " + ticks); 60 | event.setCanceled(true); 61 | } 62 | } 63 | } 64 | if (modes.getValue().equals("CubeCraft")) { 65 | if (event.getPacket() instanceof CommonPongC2SPacket) { 66 | synchronized (packetList) { 67 | packetList.add(event.getPacket()); 68 | } 69 | event.setCanceled(true); 70 | } 71 | } 72 | 73 | Speed speedModule = ModuleManager.getModule(Speed.class); 74 | if (speedModule != null && speedModule.isEnabled()) { 75 | if (event.getPacket() instanceof ClientCommandC2SPacket commandC2SPacket) { 76 | ClientCommandC2SPacket.Mode mode = commandC2SPacket.getMode(); 77 | if (mode == ClientCommandC2SPacket.Mode.PRESS_SHIFT_KEY || mode == ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY) { 78 | ChatUtils.print("Canceled"); 79 | event.setCanceled(true); 80 | } 81 | } 82 | } 83 | } 84 | 85 | 86 | @EventHandler 87 | public void onPreUpdate(PreUpdateEvent event) { 88 | if (modes.getValue().equals("Vulcan")) { 89 | if (accept) ticks++; 90 | 91 | if (ticks >= 1000) { 92 | ChatUtils.print("if you didn't get disconnected relog."); 93 | reset(); 94 | } 95 | } 96 | if (modes.getValue().equals("CubeCraft")) { 97 | if (!packetList.isEmpty()) ticks++; 98 | 99 | if (ticks >= 50) { 100 | clear(); 101 | ChatUtils.print("s"); 102 | ticks = 0; 103 | } 104 | } 105 | } 106 | 107 | private void reset() { 108 | ticks = 0; 109 | accept = false; 110 | } 111 | 112 | 113 | private void clear() { 114 | SendPacketMixinAccessor silent = (SendPacketMixinAccessor) mc.getNetworkHandler(); 115 | 116 | synchronized (packetList) { 117 | if (!packetList.isEmpty()) { 118 | for (Packet packet : packetList) { 119 | silent.getConnection().send(packet); 120 | } 121 | packetList.clear(); 122 | ChatUtils.print("Clear"); 123 | } 124 | } 125 | } 126 | 127 | } 128 | 129 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/movement/Flight.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.movement; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PacketReceivedEvent; 5 | import com.syuto.bytes.eventbus.impl.PreMotionEvent; 6 | import com.syuto.bytes.module.Module; 7 | import com.syuto.bytes.module.api.Category; 8 | import com.syuto.bytes.setting.impl.ModeSetting; 9 | import com.syuto.bytes.setting.impl.NumberSetting; 10 | import com.syuto.bytes.utils.impl.client.ChatUtils; 11 | import com.syuto.bytes.utils.impl.player.MovementUtil; 12 | import com.syuto.bytes.utils.impl.player.PlayerUtil; 13 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 14 | import io.netty.util.internal.MathUtil; 15 | import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; 16 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 17 | import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket; 18 | import net.minecraft.util.math.MathHelper; 19 | import net.minecraft.util.math.Vec3d; 20 | 21 | import java.util.Random; 22 | 23 | public class Flight extends Module { 24 | 25 | public ModeSetting modes = new ModeSetting("Mode",this,"Vanilla", "Spoof", "Damage"); 26 | public NumberSetting speed = new NumberSetting("Speed", this, 1.0d, 0, 8.0d, 0.1d); 27 | 28 | public Flight() { 29 | super("Flight", "Zoom", Category.MOVEMENT); 30 | setSuffix(() -> 31 | modes.getValue() 32 | ); 33 | } 34 | //vars 35 | private int jumps = 0, ticks = 0; 36 | private boolean damage = false; 37 | 38 | private final double[] jumpValues = { 39 | 0.41999998688698, 40 | 0.7531999805212, 41 | 1.00133597911215, 42 | 1.166109260938214, 43 | 1.24918707874468, 44 | 1.25220334025373, 45 | 1.17675927506424, 46 | 1.024424088213685, 47 | 0.7967356006687, 48 | 0.495200877005914, 49 | 0.121296840539195 50 | }; 51 | 52 | //events 53 | @Override 54 | public void onEnable() { 55 | this.jumps = 0; 56 | this.damage = false; 57 | this.ticks = 0; 58 | 59 | } 60 | 61 | @EventHandler 62 | void onPreMotion(PreMotionEvent event) { 63 | ticks = !mc.player.isOnGround() ? ticks + 1 : 0; 64 | 65 | double y; 66 | 67 | if (mc.options.jumpKey.isPressed()) { 68 | y = speed.getValue().doubleValue(); 69 | } else if (mc.options.sneakKey.isPressed()) { 70 | y = -speed.getValue().doubleValue(); 71 | } else { 72 | y = 0; 73 | } 74 | 75 | Vec3d motion = mc.player.getVelocity(); 76 | 77 | switch(modes.getValue()) { 78 | case "Vanilla" -> { 79 | mc.player.setVelocity(motion.x, y, motion.z); 80 | 81 | if (MovementUtil.isMoving()) { 82 | MovementUtil.setSpeed(speed.getValue().doubleValue()); 83 | } else { 84 | mc.player.setVelocity(0, y, 0); 85 | } 86 | } 87 | 88 | case "Spoof" -> { 89 | if (!damage) { 90 | Vec3d pos = mc.player.getPos(); 91 | 92 | mc.player.setPosition(pos.x, pos.y + 5, pos.z); 93 | damage = true; 94 | } 95 | 96 | } 97 | 98 | case "Damage" -> { 99 | if (!this.damage) { 100 | mc.player.setVelocity(0, motion.y, 0); 101 | if (jumps < 4) { 102 | event.onGround = false; 103 | if (ticks < jumpValues.length) { 104 | event.posY += jumpValues[ticks]; 105 | ticks++; 106 | } else { 107 | jumps++; 108 | ticks = 0; 109 | } 110 | if (jumps == 3 && ticks >= 2) { 111 | event.onGround = true; 112 | } 113 | } 114 | } else { 115 | mc.player.setVelocity(motion.x, y, motion.z); 116 | 117 | if (MovementUtil.isMoving()) { 118 | MovementUtil.setSpeed(speed.getValue().doubleValue()); 119 | } else { 120 | mc.player.setVelocity(0, y, 0); 121 | } 122 | } 123 | } 124 | } 125 | } 126 | 127 | 128 | @EventHandler 129 | public void onPacketReceived(PacketReceivedEvent event) { 130 | if (event.getPacket() instanceof EntityVelocityUpdateS2CPacket s12) { 131 | if (s12.getEntityId() == mc.player.getId() && modes.getValue().equals("Damage")) { 132 | this.damage = true; 133 | } 134 | } 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/FakeLag.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PacketSentEvent; 5 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 6 | import com.syuto.bytes.eventbus.impl.RenderWorldEvent; 7 | import com.syuto.bytes.mixin.SendPacketMixinAccessor; 8 | import com.syuto.bytes.module.Module; 9 | import com.syuto.bytes.module.api.Category; 10 | import com.syuto.bytes.setting.impl.NumberSetting; 11 | import com.syuto.bytes.utils.impl.client.ChatUtils; 12 | import com.syuto.bytes.utils.impl.client.ClientUtil; 13 | import com.syuto.bytes.utils.impl.render.RenderUtils; 14 | import net.minecraft.network.packet.Packet; 15 | import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; 16 | import net.minecraft.util.hit.EntityHitResult; 17 | import net.minecraft.util.hit.HitResult; 18 | import net.minecraft.util.math.Vec3d; 19 | 20 | import java.util.ArrayList; 21 | import java.util.Iterator; 22 | 23 | public class FakeLag extends Module { 24 | private final NumberSetting delaySetting = new NumberSetting( 25 | "Delay", 26 | this, 27 | 200, 28 | 1, 29 | 1000, 30 | 5 31 | ); 32 | 33 | private final ArrayList> packetList = new ArrayList<>(); 34 | private EntityHitResult entityHit; 35 | 36 | private boolean delay; 37 | 38 | private long lastDelayStart; 39 | private long lastFlushTime; 40 | 41 | private Vec3d pos, p; 42 | 43 | public FakeLag() { 44 | super("FakeLag", "Simulates lag / delayed packets", Category.COMBAT); 45 | } 46 | 47 | @Override 48 | public void onDisable() { 49 | flushAll(); 50 | } 51 | 52 | @EventHandler 53 | public void onPacketSent(PacketSentEvent event) { 54 | if (ClientUtil.nullCheck() && event.getPacket() instanceof PlayerInteractEntityC2SPacket) 55 | flushAll(); 56 | 57 | if (ClientUtil.nullCheck() && delay) { 58 | synchronized (packetList) { 59 | packetList.add(event.getPacket()); 60 | event.setCanceled(true); 61 | } 62 | } 63 | } 64 | 65 | @EventHandler 66 | public void onPreUpdate(PreUpdateEvent event) { 67 | 68 | 69 | long now = System.currentTimeMillis(); 70 | 71 | if (!delay) { 72 | delay = true; 73 | lastDelayStart = now; 74 | lastFlushTime = now; 75 | pos = mc.player.getPos(); 76 | ChatUtils.print("Delay started"); 77 | } else { 78 | long elapsed = now - lastDelayStart; 79 | 80 | var s = delaySetting.getValue().longValue(); 81 | if (!packetList.isEmpty() && now - lastFlushTime >= s) { 82 | flush(); 83 | lastFlushTime = now; 84 | } 85 | 86 | if (elapsed >= delaySetting.getValue().longValue()) { 87 | flushAll(); 88 | p = mc.player.getPos(); 89 | } 90 | } 91 | } 92 | 93 | private void flush() { 94 | if (packetList.isEmpty()) return; 95 | SendPacketMixinAccessor silent = (SendPacketMixinAccessor) mc.getNetworkHandler(); 96 | 97 | synchronized (packetList) { 98 | for (Packet packet : packetList) { 99 | silent.getConnection().send(packet); 100 | } 101 | packetList.clear(); 102 | } 103 | ChatUtils.print("Flushed"); 104 | } 105 | 106 | private void flushAll() { 107 | SendPacketMixinAccessor silent = (SendPacketMixinAccessor) mc.getNetworkHandler(); 108 | p = mc.player.getPos(); 109 | synchronized (packetList) { 110 | for (Packet packet : packetList) { 111 | silent.getConnection().send(packet); 112 | } 113 | packetList.clear(); 114 | delay = false; 115 | lastDelayStart = System.currentTimeMillis(); 116 | ChatUtils.print("Flushed all packets"); 117 | } 118 | } 119 | 120 | @EventHandler 121 | public void onRenderWorld(RenderWorldEvent e) { 122 | if (pos != null && p != null) { 123 | long now = System.currentTimeMillis(); 124 | long elapsed = now - lastDelayStart; 125 | long duration = delaySetting.getValue().longValue(); 126 | 127 | float progress = Math.min(1.0f, (float) elapsed / (float) duration); 128 | double interpX = pos.x + (p.x - pos.x) * progress; 129 | double interpY = pos.y + (p.y - pos.y) * progress; 130 | double interpZ = pos.z + (p.z - pos.z) * progress; 131 | 132 | Vec3d interpolatedPos = new Vec3d(interpX, interpY, interpZ); 133 | 134 | RenderUtils.renderp(pos, interpolatedPos, e, e.partialTicks); 135 | 136 | if (progress >= 1.0f) { 137 | pos = p; 138 | lastDelayStart = now; 139 | p = mc.player.getPos(); 140 | } 141 | } 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/render/Esp.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.render; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.RenderWorldEvent; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.utils.impl.client.ChatUtils; 8 | import com.syuto.bytes.utils.impl.render.RenderUtils; 9 | import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; 10 | import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; 11 | import net.minecraft.client.font.TextRenderer; 12 | import net.minecraft.client.gui.DrawContext; 13 | import net.minecraft.client.render.RenderLayer; 14 | import net.minecraft.client.render.VertexConsumer; 15 | import net.minecraft.client.render.VertexConsumerProvider; 16 | import net.minecraft.client.render.VertexConsumers; 17 | import net.minecraft.client.util.math.MatrixStack; 18 | import net.minecraft.entity.Entity; 19 | import net.minecraft.entity.LivingEntity; 20 | import net.minecraft.entity.boss.BossBar; 21 | import net.minecraft.entity.player.PlayerEntity; 22 | import net.minecraft.text.Text; 23 | import net.minecraft.util.math.BlockPos; 24 | import net.minecraft.util.math.Vec3d; 25 | import org.joml.Matrix4f; 26 | 27 | import java.awt.*; 28 | 29 | public class Esp extends Module { 30 | public Esp() { 31 | super("Esp", "Shows players through walls", Category.RENDER); 32 | } 33 | 34 | 35 | 36 | @EventHandler 37 | public void onRenderWorld(RenderWorldEvent event) { 38 | for (Entity entity : mc.world.getEntities()) { 39 | if (entity instanceof PlayerEntity en && entity.isAlive() && entity != mc.player) { 40 | float delta = mc.getRenderTickCounter().getTickDelta(true); 41 | RenderUtils.renderHealth( 42 | en, 43 | event, 44 | en.getHealth(), 45 | en.getMaxHealth() + en.getAbsorptionAmount(), 46 | (en.getHealth() / en.getMaxHealth() + en.getAbsorptionAmount()), 47 | delta 48 | ); 49 | } 50 | } 51 | 52 | } 53 | 54 | 55 | 56 | 57 | public boolean isEntityInView(Entity entity) { 58 | Vec3d playerLook = mc.player.getRotationVec(1.0F); 59 | Vec3d toEntity = entity.getPos().subtract(mc.player.getPos()).normalize(); 60 | double angle = Math.acos(playerLook.dotProduct(toEntity)); 61 | return Math.toDegrees(angle) < mc.options.getFov().getValue() / 1.5f; 62 | } 63 | 64 | 65 | 66 | /* 67 | if (!isEntityInView(en)) continue; 68 | float delta = mc.getRenderTickCounter().getTickDelta(true); 69 | 70 | double interpolatedX = en.prevX + (en.getX() - en.prevX) * delta; 71 | double interpolatedY = en.prevY + (en.getY() - en.prevY) * delta; 72 | double interpolatedZ = en.prevZ + (en.getZ() - en.prevZ) * delta; 73 | 74 | Box interpolatedBox = en.getBoundingBox().expand(0.15f).offset( 75 | interpolatedX - en.getX(), 76 | interpolatedY - en.getY(), 77 | interpolatedZ - en.getZ() 78 | ); 79 | 80 | Vec3d[] corners = { 81 | new Vec3d(interpolatedBox.minX, interpolatedBox.minY, interpolatedBox.minZ), 82 | new Vec3d(interpolatedBox.maxX, interpolatedBox.minY, interpolatedBox.minZ), 83 | new Vec3d(interpolatedBox.minX, interpolatedBox.maxY, interpolatedBox.minZ), 84 | new Vec3d(interpolatedBox.maxX, interpolatedBox.maxY, interpolatedBox.minZ), 85 | new Vec3d(interpolatedBox.minX, interpolatedBox.minY, interpolatedBox.maxZ), 86 | new Vec3d(interpolatedBox.maxX, interpolatedBox.minY, interpolatedBox.maxZ), 87 | new Vec3d(interpolatedBox.minX, interpolatedBox.maxY, interpolatedBox.maxZ), 88 | new Vec3d(interpolatedBox.maxX, interpolatedBox.maxY, interpolatedBox.maxZ), 89 | }; 90 | 91 | float minX = Float.MAX_VALUE, minY = Float.MAX_VALUE; 92 | float maxX = Float.MIN_VALUE, maxY = Float.MIN_VALUE; 93 | 94 | for (Vec3d corner : corners) { 95 | Vec3d screenPos = RenderUtils.worldToScreen(corner); 96 | if (screenPos != null) { 97 | minX = Math.min(minX, (float) screenPos.x); 98 | minY = Math.min(minY, (float) screenPos.y); 99 | maxX = Math.max(maxX, (float) screenPos.x); 100 | maxY = Math.max(maxY, (float) screenPos.y); 101 | } 102 | } 103 | 104 | if (minX < maxX && minY < maxY) { 105 | RenderUtils.drawRectOutline(event, minX, minY, maxX, maxY, 0xFFFFFFFF); 106 | RenderUtils.drawRect(event, minX + 0.1F, minY + 0.1F, maxX - 0.1F, maxY - 0.1F, 0x80000000); 107 | } 108 | */ 109 | 110 | 111 | } 112 | 113 | 114 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/combat/AimAssist.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.combat; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.*; 5 | import com.syuto.bytes.module.Module; 6 | import com.syuto.bytes.module.api.Category; 7 | import com.syuto.bytes.setting.impl.BooleanSetting; 8 | import com.syuto.bytes.setting.impl.NumberSetting; 9 | import com.syuto.bytes.utils.impl.player.PlayerUtil; 10 | import com.syuto.bytes.utils.impl.render.RenderUtils; 11 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 12 | import net.minecraft.client.network.AbstractClientPlayerEntity; 13 | import net.minecraft.entity.player.PlayerEntity; 14 | import net.minecraft.util.Hand; 15 | import net.minecraft.util.hit.BlockHitResult; 16 | import net.minecraft.util.hit.EntityHitResult; 17 | import net.minecraft.util.hit.HitResult; 18 | import net.minecraft.util.math.MathHelper; 19 | 20 | import java.util.ArrayList; 21 | import java.util.Comparator; 22 | import java.util.List; 23 | 24 | public class AimAssist extends Module { 25 | 26 | public AimAssist() { 27 | super("AimAssist", "Automatically aims at nearby players.", Category.COMBAT); 28 | } 29 | private final NumberSetting reach = new NumberSetting("Reach", this, 3, 1, 6, 0.5); 30 | private final NumberSetting cps = new NumberSetting("CPS", this, 10, 0, 40, 1); 31 | private final BooleanSetting rotation = new BooleanSetting("Rotations", this,true); 32 | 33 | private long lastAttackTime = 0; 34 | private final List targets = new ArrayList<>(); 35 | public static PlayerEntity target; 36 | private float[] rotations, lastRotation; 37 | 38 | @Override 39 | public void onDisable() { 40 | this.lastRotation = null; 41 | } 42 | 43 | @EventHandler 44 | public void onRotation(RotationEvent event) { 45 | if (rotation.getValue()) { 46 | if (lastRotation == null) 47 | lastRotation = new float[]{RotationUtils.getLastRotationYaw(), RotationUtils.getLastRotationPitch()}; 48 | 49 | if (target != null) { 50 | rotations = RotationUtils.getRotations( 51 | lastRotation, 52 | mc.player.getEyePos(), 53 | target 54 | ); 55 | 56 | 57 | rotations = RotationUtils.getFixedRotation(rotations, lastRotation); 58 | 59 | if ( 60 | mc.options.attackKey.isPressed() && 61 | PlayerUtil.isHoldingWeapon() && 62 | PlayerUtil.getBiblicallyAccurateDistanceToEntity(target) <= reach.getValue().doubleValue() 63 | ) { 64 | event.setYaw(rotations[0]); 65 | event.setPitch(rotations[1]); 66 | 67 | this.lastRotation = new float[]{RotationUtils.getLastRotationYaw(), RotationUtils.getLastRotationPitch()}; 68 | } 69 | } 70 | } 71 | } 72 | 73 | @EventHandler 74 | public void onPreUpdate(PreUpdateEvent event) { 75 | 76 | 77 | targets.clear(); 78 | targets.addAll(mc.world.getPlayers().stream() 79 | .filter(ent -> ent != mc.player) 80 | .sorted(Comparator.comparingDouble(PlayerUtil::getBiblicallyAccurateDistanceToEntity)) 81 | .limit(1) 82 | .toList()); 83 | 84 | target = null; 85 | for (AbstractClientPlayerEntity player : mc.world.getPlayers()) { 86 | if (player != mc.player && PlayerUtil.getBiblicallyAccurateDistanceToEntity(player) <= reach.getValue().doubleValue()) { 87 | target = player; 88 | break; 89 | } 90 | } 91 | 92 | if (target == null || rotations == null) return; 93 | if (!mc.options.attackKey.isPressed() || !PlayerUtil.isHoldingWeapon()) return; 94 | 95 | 96 | EntityHitResult result = (EntityHitResult) PlayerUtil.raycast( 97 | RotationUtils.getRotationYaw(), 98 | RotationUtils.getRotationPitch(), 99 | reach.getValue().doubleValue(), 100 | delta, 101 | false 102 | ); 103 | 104 | if (result != null && result.getEntity().equals(target)) { 105 | double cpsValue = cps.getValue().doubleValue(); 106 | long delay = (long) (1000.0 / cpsValue); 107 | 108 | long currentTime = System.currentTimeMillis(); 109 | if (cpsValue == 0) { 110 | if (mc.player.getAttackCooldownProgress(0.5f) >= 1.0) { 111 | mc.interactionManager.attackEntity(mc.player, target); 112 | mc.player.swingHand(mc.player.getActiveHand()); 113 | } 114 | } else if (currentTime - lastAttackTime >= delay) { 115 | mc.interactionManager.attackEntity(mc.player, target); 116 | mc.player.swingHand(Hand.MAIN_HAND); 117 | lastAttackTime = currentTime; 118 | } 119 | } 120 | 121 | } 122 | 123 | @EventHandler 124 | public void onRenderWorld(RenderWorldEvent e) { 125 | if (target != null) { 126 | 127 | RenderUtils.renderBox(target, e, e.partialTicks); 128 | } 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /src/main/java/com/syuto/bytes/module/impl/player/Test.java: -------------------------------------------------------------------------------- 1 | package com.syuto.bytes.module.impl.player; 2 | 3 | import com.syuto.bytes.eventbus.EventHandler; 4 | import com.syuto.bytes.eventbus.impl.PreMotionEvent; 5 | import com.syuto.bytes.eventbus.impl.PreUpdateEvent; 6 | import com.syuto.bytes.eventbus.impl.RenderWorldEvent; 7 | import com.syuto.bytes.module.Module; 8 | import com.syuto.bytes.module.api.Category; 9 | import com.syuto.bytes.setting.impl.NumberSetting; 10 | import com.syuto.bytes.utils.impl.client.ChatUtils; 11 | import com.syuto.bytes.utils.impl.player.MovementUtil; 12 | import com.syuto.bytes.utils.impl.player.PlayerUtil; 13 | import com.syuto.bytes.utils.impl.player.WorldUtil; 14 | import com.syuto.bytes.utils.impl.render.RenderUtils; 15 | import com.syuto.bytes.utils.impl.rotation.RotationUtils; 16 | import net.minecraft.block.Block; 17 | import net.minecraft.block.Blocks; 18 | import net.minecraft.client.option.KeyBinding; 19 | import net.minecraft.util.Hand; 20 | import net.minecraft.util.hit.BlockHitResult; 21 | import net.minecraft.util.hit.HitResult; 22 | import net.minecraft.util.math.BlockPos; 23 | import net.minecraft.util.math.Direction; 24 | import net.minecraft.util.math.MathHelper; 25 | import net.minecraft.util.math.Vec3d; 26 | 27 | import java.awt.*; 28 | import java.util.List; 29 | import java.util.stream.IntStream; 30 | 31 | import static com.syuto.bytes.Byte.mc; 32 | 33 | 34 | public class Test extends Module { 35 | 36 | public NumberSetting range = new NumberSetting("range", this, 3, 3, 50, 1); 37 | 38 | public Test() { 39 | super("Test", "Testing module", Category.PLAYER); 40 | } 41 | 42 | 43 | private BlockPos block, placePos; 44 | private Direction facing; 45 | private float[] rots; 46 | private int ticks; 47 | List pos; 48 | 49 | @EventHandler 50 | void onRenderWorld(RenderWorldEvent event) { 51 | if (pos != null && !pos.isEmpty()) { 52 | for (BlockPos po : pos) { 53 | Block e = mc.world.getBlockState(po).getBlock(); 54 | if (e == Blocks.DIAMOND_ORE || e == Blocks.DEEPSLATE_DIAMOND_ORE) { 55 | RenderUtils.renderBlock(po, event, Color.CYAN); 56 | } else if (e == Blocks.IRON_ORE || e == Blocks.DEEPSLATE_IRON_ORE) { 57 | RenderUtils.renderBlock(po, event, Color.WHITE); 58 | } else if (e == Blocks.COAL_ORE || e == Blocks.DEEPSLATE_COAL_ORE) { 59 | RenderUtils.renderBlock(po, event, Color.BLACK); 60 | } else if (e == Blocks.LAPIS_ORE || e == Blocks.DEEPSLATE_LAPIS_ORE) { 61 | RenderUtils.renderBlock(po, event, Color.BLUE); 62 | } else if (e == Blocks.ANCIENT_DEBRIS) { 63 | RenderUtils.renderBlock(po, event, Color.MAGENTA); 64 | } else if (e == Blocks.EMERALD_ORE || e == Blocks.DEEPSLATE_EMERALD_ORE){ 65 | RenderUtils.renderBlock(po, event, Color.GREEN); 66 | } else if (e == Blocks.GOLD_ORE || e == Blocks.DEEPSLATE_GOLD_ORE || e == Blocks.GOLD_BLOCK) { 67 | RenderUtils.renderBlock(po, event, Color.YELLOW); 68 | } else { 69 | RenderUtils.renderBlock(po, event, Color.PINK); 70 | } 71 | } 72 | } 73 | } 74 | 75 | @EventHandler 76 | void onPreUpdate(PreUpdateEvent event) { 77 | pos = WorldUtil.findAllOres(mc.player.getBlockPos(), range.getValue().intValue()); 78 | 79 | /*ticks = mc.player.isOnGround() ? 0 : ticks + 1; 80 | 81 | this.block = WorldUtil.findBlocks( 82 | mc.player.getBlockPos(), 83 | 3 84 | 85 | ); 86 | 87 | if (this.block != null && !mc.player.isOnGround()) { 88 | this.facing = WorldUtil.getClosest(this.block); 89 | if (this.facing != null && WorldUtil.canBePlacedOn(this.block)) { 90 | if (mc.world.getBlockState(mc.player.getBlockPos().down()).isAir() && ticks >= 9) { 91 | mc.options.sprintKey.setPressed(false); 92 | mc.player.setSprinting(false); 93 | this.place(block, facing); 94 | if (this.block != null) { 95 | //ChatUtils.print(this.facing.asString()); 96 | this.rots = RotationUtils.getBlockRotations(this.block, this.facing); 97 | } 98 | } else { 99 | mc.player.setSprinting(true); 100 | mc.options.sprintKey.setPressed(true); 101 | rots = null; 102 | } 103 | } 104 | }*/ 105 | } 106 | 107 | 108 | @EventHandler 109 | void onPreMotion(PreMotionEvent event) { 110 | 111 | 112 | if (this.rots != null) { 113 | // event.yaw = rots[0]; 114 | // event.pitch = rots[1]; 115 | // RotationUtils.turnHead(event.yaw); 116 | } 117 | } 118 | 119 | private void place(BlockPos pos, Direction direction) { 120 | //ChatUtils.print(direction.asString()); 121 | BlockHitResult result = new BlockHitResult( 122 | pos.toCenterPos(), 123 | direction, 124 | pos, 125 | false 126 | ); 127 | 128 | mc.interactionManager.interactBlock(mc.player, mc.player.getActiveHand(), result); 129 | mc.player.swingHand(mc.player.getActiveHand()); 130 | 131 | } 132 | 133 | } -------------------------------------------------------------------------------- /src/main/kotlin/dev/blend/ui/dropdown/components/CategoryComponent.kt: -------------------------------------------------------------------------------- 1 | package dev.blend.ui.dropdown.components 2 | 3 | import com.syuto.bytes.Byte.mc 4 | import com.syuto.bytes.module.ModuleManager 5 | import com.syuto.bytes.module.api.Category 6 | import dev.blend.ThemeHandler 7 | import dev.blend.ui.AbstractUIComponent 8 | import dev.blend.ui.dropdown.DropdownClickGUI 9 | import dev.blend.util.animations.* 10 | import dev.blend.util.render.Alignment 11 | import dev.blend.util.render.DrawUtil 12 | import org.lwjgl.glfw.GLFW 13 | import kotlin.math.max 14 | 15 | class CategoryComponent( 16 | private val category: Category 17 | ): AbstractUIComponent( 18 | width = 100.0, 19 | height = 20.0 20 | ) { 21 | 22 | val components = mutableListOf() 23 | val openAnimation = BackOutAnimation() 24 | private val expandAnimation = SineOutAnimation() 25 | private val expandToggleAnimation = SineOutAnimation() 26 | private val initialHeight = height; 27 | private var expanded = true 28 | 29 | init { 30 | ModuleManager.modules.filter { 31 | it.category == category 32 | }.forEach { 33 | components.add(ModuleComponent(this, it)) 34 | } 35 | } 36 | 37 | override fun init() { 38 | 39 | openAnimation.set(0.5) 40 | openAnimation.reset() 41 | components.forEach { 42 | it.init() 43 | } 44 | } 45 | 46 | override fun render(mouseX: Int, mouseY: Int) { 47 | DrawUtil.save() 48 | DrawUtil.translate( 49 | // (mc.window.scaledWidth / 2.0) * (1.0 - openAnimation.get()), 50 | 0, 51 | (mc.window.scaledHeight) * (1.0 - openAnimation.get()) 52 | ) 53 | // DrawUtil.scale(openAnimation.get()) // max needed to prevent back out animation from going negative 54 | DrawUtil.scissor(x, y, width, height) 55 | DrawUtil.roundedRect(x, y, width, height, 5, ThemeHandler.getBackground()) 56 | DrawUtil.drawString(category.properName, x + (width / 2), y + (initialHeight / 2), 12, ThemeHandler.getTextColor(), Alignment.CENTER) 57 | 58 | var veryRealHeight = initialHeight 59 | components.forEach { 60 | it.x = x 61 | it.y = y + veryRealHeight 62 | it.width = width 63 | it.render(mouseX, mouseY) 64 | veryRealHeight += 65 | if (it.isExpanding()) { 66 | it.expandAnimation.get() 67 | } else { 68 | it.height 69 | } 70 | } 71 | DrawUtil.resetScissor() 72 | DrawUtil.resetTranslate() 73 | DrawUtil.restore() 74 | if (canAnimateExpansion()) { 75 | this.height = expandAnimation.get() 76 | } else { 77 | expandAnimation.set(veryRealHeight) 78 | this.height = veryRealHeight 79 | } 80 | // base duration(200ms) * max(1.0, (height / how much height it should cover within the base duration of 200ms)) 81 | // just adjust the base height this is what I think works alright... 82 | // also use max to make sure animation doesn't go superfast 83 | // that is animate with a duration lesser than 100ms 84 | expandAnimation.duration = 200 * max(1.0, (veryRealHeight / 150)) 85 | openAnimation.animate( 86 | if (DropdownClickGUI.requestsClose) { 87 | 0.0 88 | } else { 89 | 1.0 90 | } 91 | ) 92 | openAnimation.duration = 200.0 + (50.0 * DropdownClickGUI.components.indexOf(this)) 93 | expandAnimation.animate( 94 | if (expanded) veryRealHeight else initialHeight 95 | ) 96 | expandToggleAnimation.animate(if (expanded) 1.0 else 0.0) 97 | } 98 | 99 | override fun click(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 100 | if (isOver(x, y, width, initialHeight, mouseX, mouseY)) { 101 | if (mouseButton == GLFW.GLFW_MOUSE_BUTTON_LEFT) { 102 | return true 103 | } else if (mouseButton == GLFW.GLFW_MOUSE_BUTTON_RIGHT) { 104 | expanded = !expanded 105 | return true 106 | } 107 | } 108 | if (expanded) { 109 | components.forEach { 110 | if (it.isOver(mouseX, mouseY)) { 111 | if (it.click(mouseX, mouseY, mouseButton)) { 112 | return true 113 | } 114 | } 115 | } 116 | } 117 | return false 118 | } 119 | 120 | override fun release(mouseX: Double, mouseY: Double, mouseButton: Int): Boolean { 121 | components.forEach { 122 | if (it.release(mouseX, mouseY, mouseButton)) { 123 | return true 124 | } 125 | } 126 | return false 127 | } 128 | 129 | override fun key(key: Int, scancode: Int, modifiers: Int): Boolean { 130 | components.forEach { 131 | if (it.key(key, scancode, modifiers)) { 132 | return true 133 | } 134 | } 135 | return false 136 | } 137 | 138 | override fun close() { 139 | components.forEach { 140 | it.close() 141 | } 142 | } 143 | 144 | fun canAnimateExpansion(): Boolean { 145 | return !components.any { it.isExpanding() } 146 | } 147 | 148 | fun isExpanding(): Boolean { 149 | return !expandAnimation.finished 150 | } 151 | 152 | } --------------------------------------------------------------------------------