├── .gitignore ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src └── main ├── java └── net │ └── bakje │ └── bhack │ ├── bhack.java │ ├── mixin │ ├── ClientPlayerEntityMixin.java │ └── ExampleMixin.java │ ├── modules │ ├── Aura.java │ ├── AutoCrystal.java │ ├── AutoTotem.java │ ├── Boost.java │ ├── ElytraEquip.java │ └── Yaw.java │ └── util │ └── TimerUtil.java └── resources ├── assets └── bhack │ └── icon.png ├── bhack.mixins.json └── fabric.mod.json /.gitignore: -------------------------------------------------------------------------------- 1 | # gradle 2 | 3 | .gradle/ 4 | build/ 5 | out/ 6 | classes/ 7 | 8 | # eclipse 9 | 10 | *.launch 11 | 12 | # idea 13 | 14 | .idea/ 15 | *.iml 16 | *.ipr 17 | *.iws 18 | 19 | # vscode 20 | 21 | .settings/ 22 | .vscode/ 23 | bin/ 24 | .classpath 25 | .project 26 | 27 | # macos 28 | 29 | *.DS_Store 30 | 31 | # fabric 32 | 33 | run/ 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bhack 2 | welcome to the best 1.18.1 fabric client out there 3 | 4 | pls help what is a boolean 5 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'fabric-loom' version '0.10-SNAPSHOT' 3 | id 'maven-publish' 4 | } 5 | 6 | sourceCompatibility = JavaVersion.VERSION_17 7 | targetCompatibility = JavaVersion.VERSION_17 8 | 9 | archivesBaseName = project.archives_base_name 10 | version = project.mod_version 11 | group = project.maven_group 12 | 13 | repositories { 14 | // Add repositories to retrieve artifacts from in here. 15 | // You should only use this when depending on other mods because 16 | // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. 17 | // See https://docs.gradle.org/current/userguide/declaring_repositories.html 18 | // for more information about repositories. 19 | } 20 | 21 | dependencies { 22 | // To change the versions see the gradle.properties file 23 | minecraft "com.mojang:minecraft:${project.minecraft_version}" 24 | mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" 25 | modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" 26 | 27 | // Fabric API. This is technically optional, but you probably want it anyway. 28 | modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" 29 | } 30 | 31 | processResources { 32 | inputs.property "version", project.version 33 | 34 | filesMatching("fabric.mod.json") { 35 | expand "version": project.version 36 | } 37 | } 38 | 39 | tasks.withType(JavaCompile).configureEach { 40 | // Minecraft 1.18 (1.18-pre2) upwards uses Java 17. 41 | it.options.release = 17 42 | } 43 | 44 | java { 45 | // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task 46 | // if it is present. 47 | // If you remove this line, sources will not be generated. 48 | withSourcesJar() 49 | } 50 | 51 | jar { 52 | from("LICENSE") { 53 | rename { "${it}_${project.archivesBaseName}"} 54 | } 55 | } 56 | 57 | // configure the maven publication 58 | publishing { 59 | publications { 60 | mavenJava(MavenPublication) { 61 | from components.java 62 | } 63 | } 64 | 65 | // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. 66 | repositories { 67 | // Add repositories to publish to here. 68 | // Notice: This block does NOT have the same function as the block in the top level. 69 | // The repositories here will be used for publishing your artifact, not for 70 | // retrieving dependencies. 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Done to increase the memory available to gradle. 2 | org.gradle.jvmargs=-Xmx1G 3 | 4 | # Fabric Properties 5 | # check these on https://fabricmc.net/develop 6 | minecraft_version=1.18.1 7 | yarn_mappings=1.18.1+build.18 8 | loader_version=0.12.12 9 | 10 | # Mod Properties 11 | mod_version = 0.3 12 | maven_group = net.bakje 13 | archives_base_name = bhack 14 | 15 | # Dependencies 16 | fabric_version=0.46.0+1.18 17 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakjedev/bhack/dd901c5b0e55da866e2254f0624080c89e8616a8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakjedev/bhack/dd901c5b0e55da866e2254f0624080c89e8616a8/gradlew -------------------------------------------------------------------------------- /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 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | name = 'Fabric' 5 | url = 'https://maven.fabricmc.net/' 6 | } 7 | mavenCentral() 8 | gradlePluginPortal() 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/bhack.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack; 2 | 3 | import net.fabricmc.api.ClientModInitializer; 4 | import net.minecraft.client.MinecraftClient; 5 | import net.minecraft.text.LiteralText; 6 | 7 | public class bhack implements ClientModInitializer { 8 | @Override 9 | public void onInitializeClient() { 10 | // idk what to do here 11 | MinecraftClient mc = MinecraftClient.getInstance(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/mixin/ClientPlayerEntityMixin.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.mixin; 2 | 3 | import net.minecraft.client.MinecraftClient; 4 | import net.minecraft.client.network.ClientPlayerEntity; 5 | import net.minecraft.network.packet.s2c.play.EntitySetHeadYawS2CPacket; 6 | import net.minecraft.text.LiteralText; 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(value={ClientPlayerEntity.class}) 13 | public abstract class ClientPlayerEntityMixin { 14 | private static final MinecraftClient mc = MinecraftClient.getInstance(); 15 | 16 | @Inject(at={@At(value="HEAD")}, method={"sendChatMessage"}, cancellable=true) 17 | public void onChatMessage(String message, CallbackInfo ci) { 18 | message = message.toLowerCase(); 19 | if (message.startsWith(".") && 20 | !message.equals(".help") && 21 | !message.equals(".toggle") && 22 | !message.equals(".toggle fly") && 23 | !message.equals(".d") && 24 | !message.equals(".server")) { 25 | mc.player.sendMessage(new LiteralText("[bhack] Unknown or incomplete command, try .help for the list of commands."), false); 26 | ci.cancel(); 27 | } 28 | 29 | if(message.equals(".help")) { 30 | mc.player.sendMessage(new LiteralText("[bhack] Commands : toggle , server, d "), false); 31 | ci.cancel(); 32 | } 33 | 34 | if(message.equals(".toggle")) { 35 | mc.player.sendMessage(new LiteralText("[bhack] Modules: fly"), false); 36 | ci.cancel(); 37 | } 38 | 39 | if(message.equals(".toggle fly")) { 40 | mc.player.getAbilities().allowFlying = !mc.player.getAbilities().allowFlying; 41 | if (mc.player.getAbilities().allowFlying) {mc.player.sendMessage(new LiteralText("[bhack] Toggled fly on."), false);} else {mc.player.sendMessage(new LiteralText("[bhack] Toggled fly off."), false);} 42 | ci.cancel(); 43 | } 44 | 45 | if (message.equals(".server")) { 46 | mc.player.sendMessage(new LiteralText("[bhack] " + mc.player.getServerBrand()), false); 47 | ci.cancel(); 48 | } 49 | 50 | else if (message.equals(".d")) { 51 | mc.player.sendMessage(new LiteralText("[bhack] Trying to kick the player."), false); 52 | dotDBypsas(); 53 | ci.cancel(); 54 | } 55 | } 56 | public void dotDBypsas() { //shhhhhhh 57 | if(mc.player.getVehicle() == null) { 58 | return; 59 | } 60 | for (int i = 0; i < 38; i++) { 61 | mc.player.networkHandler.sendPacket(new EntitySetHeadYawS2CPacket(mc.player.getVehicle(), Byte.MAX_VALUE)); 62 | } 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/mixin/ExampleMixin.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.mixin; 2 | 3 | 4 | import net.minecraft.client.gui.screen.TitleScreen; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(TitleScreen.class) 11 | public class ExampleMixin { 12 | @Inject(at = @At("HEAD"), method = "init()V") 13 | private void init(CallbackInfo info) { 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/modules/Aura.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.modules; 2 | 3 | import net.fabricmc.api.ClientModInitializer; 4 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 5 | import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; 6 | import net.minecraft.client.MinecraftClient; 7 | import net.minecraft.client.option.KeyBinding; 8 | import net.minecraft.client.util.InputUtil; 9 | import net.minecraft.entity.Entity; 10 | import net.minecraft.entity.player.PlayerEntity; 11 | import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; 12 | import net.minecraft.text.LiteralText; 13 | import org.lwjgl.glfw.GLFW; 14 | 15 | public class Aura implements ClientModInitializer { 16 | 17 | private boolean Aura = false; 18 | private boolean AuraRotations = false; 19 | 20 | @Override 21 | public void onInitializeClient() { 22 | KeyBinding binding1 = KeyBindingHelper.registerKeyBinding(new KeyBinding("Aura", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "bhack")); 23 | KeyBinding binding2 = KeyBindingHelper.registerKeyBinding(new KeyBinding("AuraRotations", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "bhack")); 24 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 25 | MinecraftClient mc = MinecraftClient.getInstance(); 26 | 27 | while (binding1.wasPressed()) { 28 | client.player.sendMessage(new LiteralText("[bhack] Set Aura to " + !Aura), false); 29 | Aura =!Aura; 30 | } 31 | 32 | while (binding2.wasPressed()) { 33 | client.player.sendMessage(new LiteralText("[bhack] Set AuraRotations to " + !AuraRotations), false); 34 | AuraRotations =!AuraRotations; 35 | } 36 | 37 | if (Aura & mc.player != null){ 38 | for (Entity target: mc.world.getEntities()) { 39 | if (target instanceof PlayerEntity) { 40 | if (mc.player.distanceTo(target) > 0.1 & mc.player.distanceTo(target) < 5) { 41 | if (AuraRotations) { 42 | double dX = mc.player.getX() - target.getX(); 43 | double dY = mc.player.getY() - target.getY(); 44 | double dZ = mc.player.getZ() - target.getZ(); 45 | 46 | double DistanceXZ = Math.sqrt(dX * dX + dZ * dZ); 47 | double DistanceY = Math.sqrt(DistanceXZ * DistanceXZ + dY * dY); 48 | 49 | double newYaw = Math.acos(dX / DistanceXZ) * 180 / Math.PI; 50 | double newPitch = Math.acos(dY / -DistanceY) * 180 / Math.PI - 90; 51 | 52 | if (dZ < 0.0) 53 | newYaw = newYaw + Math.abs(180 - newYaw) * 2; 54 | newYaw = (newYaw + 90); 55 | 56 | 57 | //client side 58 | //mc.player.setYaw((float) newYaw); 59 | //mc.player.setPitch((float) newPitch); 60 | 61 | //just serverside 62 | mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.Full(mc.player.getX(), mc.player.getY(), mc.player.getZ(), (float) newYaw, (float) newPitch, mc.player.isOnGround())); 63 | } 64 | float cooldown = mc.player.getAttackCooldownProgress(mc.getTickDelta()); 65 | if (cooldown==1) { 66 | mc.interactionManager.attackEntity(mc.player, target); 67 | } 68 | } 69 | } 70 | } 71 | } 72 | }); 73 | } 74 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/modules/AutoCrystal.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.modules; 2 | 3 | import net.fabricmc.api.ClientModInitializer; 4 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 5 | import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; 6 | import net.minecraft.block.Blocks; 7 | import net.minecraft.client.MinecraftClient; 8 | import net.minecraft.client.option.KeyBinding; 9 | import net.minecraft.client.util.InputUtil; 10 | import net.minecraft.entity.Entity; 11 | import net.minecraft.entity.decoration.EndCrystalEntity; 12 | import net.minecraft.entity.player.PlayerEntity; 13 | import net.minecraft.text.LiteralText; 14 | import net.minecraft.util.math.BlockPos; 15 | import org.lwjgl.glfw.GLFW; 16 | 17 | 18 | public class AutoCrystal implements ClientModInitializer { 19 | 20 | private boolean AutoCrystal =false; 21 | 22 | @Override 23 | public void onInitializeClient() { 24 | KeyBinding binding1 = KeyBindingHelper.registerKeyBinding(new KeyBinding("AutoCrystal", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "bhack")); 25 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 26 | MinecraftClient mc = MinecraftClient.getInstance(); 27 | 28 | while (binding1.wasPressed()) { 29 | client.player.sendMessage(new LiteralText("[bhack] Set AutoCrystal to " + !AutoCrystal), false); 30 | AutoCrystal =!AutoCrystal; 31 | } 32 | 33 | if (AutoCrystal & mc.player != null){ 34 | for (Entity target: mc.world.getEntities()) { 35 | if (target instanceof EndCrystalEntity & mc.player.distanceTo(target) < 5 & mc.player.getHealth() > 10) { 36 | mc.interactionManager.attackEntity(mc.player, target); 37 | } 38 | if (target instanceof PlayerEntity & mc.player.distanceTo(target) > 0.1 & mc.player.distanceTo(target) < 5) { 39 | double cx = target.getBlockX(); 40 | double cy = target.getBlockY(); 41 | double cz = target.getBlockZ(); 42 | if (mc.world.getBlockState(new BlockPos(cx+1, cy-1, cz)).isOf(Blocks.OBSIDIAN) || 43 | mc.world.getBlockState(new BlockPos(cx+1, cy-1, cz)).isOf(Blocks.BEDROCK)) { 44 | if (mc.world.getBlockState(new BlockPos(cx+1, cy, cz)).isOf(Blocks.AIR)) { 45 | client.player.sendMessage(new LiteralText("[bhack] AutoCrystal"), false); 46 | 47 | } 48 | } 49 | } 50 | } 51 | } 52 | }); 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/modules/AutoTotem.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.modules; 2 | 3 | import net.bakje.bhack.util.TimerUtil; 4 | import net.fabricmc.api.ClientModInitializer; 5 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 6 | import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; 7 | import net.minecraft.client.MinecraftClient; 8 | import net.minecraft.client.option.KeyBinding; 9 | import net.minecraft.client.util.InputUtil; 10 | import net.minecraft.item.Items; 11 | import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; 12 | import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; 13 | import net.minecraft.text.LiteralText; 14 | import net.minecraft.util.math.BlockPos; 15 | import net.minecraft.util.math.Direction; 16 | import org.lwjgl.glfw.GLFW; 17 | 18 | public class AutoTotem implements ClientModInitializer { 19 | 20 | private boolean AutoTotem = false; 21 | public TimerUtil timer = new TimerUtil(); 22 | @Override 23 | public void onInitializeClient() { 24 | KeyBinding binding1 = KeyBindingHelper.registerKeyBinding(new KeyBinding("AutoTotem", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "bhack")); 25 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 26 | MinecraftClient mc = MinecraftClient.getInstance(); 27 | 28 | while (binding1.wasPressed()) { 29 | client.player.sendMessage(new LiteralText("[bhack] Set AutoTotem to " + !AutoTotem), false); 30 | AutoTotem =!AutoTotem; 31 | } 32 | // WARNING!!!! this autototem only moves totems from JUST your HOTBAR to your offhand 33 | // when your offhand slot is empty, this is purely because when testing on ecme im scared 34 | // this also isnt silent swap at all and actually switches to your totem client and server side 35 | if (AutoTotem && mc.player != null) { 36 | boolean hasTotem = mc.player.getOffHandStack().getItem() == Items.TOTEM_OF_UNDYING; 37 | if (!hasTotem) { 38 | for (int slot = 0; slot < 9; slot++){ 39 | if (mc.player.getInventory().getStack(slot).getItem() == Items.TOTEM_OF_UNDYING) { //look for totem 40 | if (slot != mc.player.getInventory().selectedSlot) { // if its not already selected 41 | mc.player.getInventory().selectedSlot = slot; // select it 42 | mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(slot)); // send that to server 43 | } 44 | if (timer.passed(100)) { 45 | mc.player.networkHandler.sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.SWAP_ITEM_WITH_OFFHAND, BlockPos.ORIGIN, Direction.DOWN)); // honestly dont get the blockpos.origin and direction.down part this line is skidded 46 | timer.reset(); 47 | } 48 | } 49 | } 50 | } 51 | } 52 | }); 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/modules/Boost.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.modules; 2 | 3 | import net.fabricmc.api.ClientModInitializer; 4 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 5 | import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; 6 | import net.minecraft.client.MinecraftClient; 7 | import net.minecraft.client.option.KeyBinding; 8 | import net.minecraft.client.util.InputUtil; 9 | import net.minecraft.text.LiteralText; 10 | import org.lwjgl.glfw.GLFW; 11 | 12 | public class Boost implements ClientModInitializer { 13 | 14 | private boolean Boost = false; 15 | 16 | @Override 17 | public void onInitializeClient() { 18 | KeyBinding binding1 = KeyBindingHelper.registerKeyBinding(new KeyBinding("Boost", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "bhack")); 19 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 20 | MinecraftClient mc = MinecraftClient.getInstance(); 21 | 22 | while (binding1.wasPressed()) { 23 | client.player.sendMessage(new LiteralText("[bhack] Set Boost to " + !Boost), false); 24 | Boost =!Boost; 25 | } 26 | 27 | if (Boost){ 28 | if (mc.player != null) { 29 | mc.player.setVelocity(mc.player.getVelocity().x*1.1, mc.player.getVelocity().y, mc.player.getVelocity().z*1.1); 30 | } 31 | } 32 | }); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/modules/ElytraEquip.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.modules; 2 | 3 | import net.fabricmc.api.ClientModInitializer; 4 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 5 | import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; 6 | import net.minecraft.client.MinecraftClient; 7 | import net.minecraft.client.option.KeyBinding; 8 | import net.minecraft.client.util.InputUtil; 9 | import net.minecraft.item.ElytraItem; 10 | import net.minecraft.item.ItemStack; 11 | import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; 12 | import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; 13 | import net.minecraft.text.LiteralText; 14 | import net.minecraft.util.Hand; 15 | import org.lwjgl.glfw.GLFW; 16 | 17 | public class ElytraEquip implements ClientModInitializer { 18 | 19 | private int elytraSlot; 20 | 21 | @Override 22 | public void onInitializeClient() { 23 | //this is for testing purposes. and learning how to find items in inventory, basically useless 24 | KeyBinding binding1 = KeyBindingHelper.registerKeyBinding(new KeyBinding("ElytraEquip", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "bhack")); 25 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 26 | MinecraftClient mc = MinecraftClient.getInstance(); 27 | 28 | while (binding1.wasPressed()) { 29 | client.player.sendMessage(new LiteralText("[bhack] Equipped elytra"), false); 30 | int currentSlot = mc.player.getInventory().selectedSlot; 31 | if (mc.player != null) { 32 | // this do the finding of the elytra in your inventory 33 | for (int slot= 0; slot < 36; slot++){ 34 | ItemStack stack = mc.player.getInventory().getStack(slot); 35 | if (stack.getItem() instanceof ElytraItem && slot<=8) { 36 | elytraSlot = slot; 37 | // this thing make it do the silent swap 38 | mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(elytraSlot)); 39 | mc.player.networkHandler.sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND)); 40 | mc.player.networkHandler.sendPacket(new UpdateSelectedSlotC2SPacket(currentSlot)); 41 | } 42 | } 43 | } 44 | } 45 | }); 46 | } 47 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/modules/Yaw.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.modules; 2 | 3 | import net.fabricmc.api.ClientModInitializer; 4 | import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; 5 | import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; 6 | import net.minecraft.client.MinecraftClient; 7 | import net.minecraft.client.option.KeyBinding; 8 | import net.minecraft.client.util.InputUtil; 9 | import net.minecraft.text.LiteralText; 10 | import org.lwjgl.glfw.GLFW; 11 | 12 | public class Yaw implements ClientModInitializer { 13 | 14 | private boolean Yaw = false; 15 | 16 | @Override 17 | public void onInitializeClient() { 18 | KeyBinding binding1 = KeyBindingHelper.registerKeyBinding(new KeyBinding("45Yaw", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_UNKNOWN, "bhack")); 19 | ClientTickEvents.END_CLIENT_TICK.register(client -> { 20 | MinecraftClient mc = MinecraftClient.getInstance(); 21 | 22 | while (binding1.wasPressed()) { 23 | client.player.sendMessage(new LiteralText("[bhack] Set 45Yaw to " + !Yaw), false); 24 | Yaw=!Yaw; 25 | } 26 | 27 | if (Yaw){ 28 | if (mc.player != null) { 29 | mc.player.setYaw(Math.round(mc.player.headYaw/45)*45); 30 | 31 | } 32 | } 33 | }); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/net/bakje/bhack/util/TimerUtil.java: -------------------------------------------------------------------------------- 1 | package net.bakje.bhack.util; 2 | 3 | public class TimerUtil { 4 | private long time; 5 | 6 | public TimerUtil() 7 | { 8 | time = -1; 9 | } 10 | 11 | public boolean passed(double ms) 12 | { 13 | return System.currentTimeMillis() - this.time >= ms; 14 | } 15 | 16 | public void reset() 17 | { 18 | this.time = System.currentTimeMillis(); 19 | } 20 | 21 | public void resetTimeSkipTo(long p_MS) 22 | { 23 | this.time = System.currentTimeMillis() + p_MS; 24 | } 25 | 26 | public long getTime() 27 | { 28 | return time; 29 | } 30 | 31 | public void setTime(long time) 32 | { 33 | this.time = time; 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/resources/assets/bhack/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bakjedev/bhack/dd901c5b0e55da866e2254f0624080c89e8616a8/src/main/resources/assets/bhack/icon.png -------------------------------------------------------------------------------- /src/main/resources/bhack.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "minVersion": "0.8", 4 | "package": "net.bakje.bhack.mixin", 5 | "compatibilityLevel": "JAVA_17", 6 | "mixins": [ 7 | ], 8 | "client": [ 9 | "ExampleMixin", 10 | "ClientPlayerEntityMixin" 11 | ], 12 | "injectors": { 13 | "defaultRequire": 1 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "bhack", 4 | "version": "${version}", 5 | 6 | "name": "bhack", 7 | "description": "the best 1.18.1 client out there right now", 8 | "authors": [ 9 | "bakje" 10 | ], 11 | "contact": { 12 | "homepage": "", 13 | "sources": "" 14 | }, 15 | 16 | "license": "MIT", 17 | "icon": "assets/bhack/icon.png", 18 | 19 | "environment": "*", 20 | "entrypoints": { 21 | "client": [ 22 | "net.bakje.bhack.bhack", 23 | "net.bakje.bhack.modules.Yaw", 24 | "net.bakje.bhack.modules.ElytraEquip", 25 | "net.bakje.bhack.modules.AutoTotem", 26 | "net.bakje.bhack.modules.Boost", 27 | "net.bakje.bhack.modules.AutoCrystal", 28 | "net.bakje.bhack.modules.Aura" 29 | ] 30 | }, 31 | "mixins": [ 32 | "bhack.mixins.json" 33 | ], 34 | 35 | "depends": { 36 | "fabricloader": ">=0.11.3", 37 | "fabric": "*", 38 | "minecraft": "1.18.x", 39 | "java": ">=17", 40 | "fabric-key-binding-api-v1": "*", 41 | "fabric-api-base": "*" 42 | }, 43 | "suggests": { 44 | "another-mod": "*" 45 | } 46 | } 47 | --------------------------------------------------------------------------------