diff --git a/src/main/java/net/wurstclient/hack/HackList.java b/src/main/java/net/wurstclient/hack/HackList.java index 9452762410..2cb14067c5 100644 --- a/src/main/java/net/wurstclient/hack/HackList.java +++ b/src/main/java/net/wurstclient/hack/HackList.java @@ -121,6 +121,7 @@ public final class HackList implements UpdateListener public final KillPotionHack killPotionHack = new KillPotionHack(); public final LiquidsHack liquidsHack = new LiquidsHack(); public final LsdHack lsdHack = new LsdHack(); + public final MaceDmgHack maceDmgHack = new MaceDmgHack(); public final MassTpaHack massTpaHack = new MassTpaHack(); public final MileyCyrusHack mileyCyrusHack = new MileyCyrusHack(); public final MobEspHack mobEspHack = new MobEspHack(); diff --git a/src/main/java/net/wurstclient/hacks/CriticalsHack.java b/src/main/java/net/wurstclient/hacks/CriticalsHack.java index abc848fe81..d48519352c 100644 --- a/src/main/java/net/wurstclient/hacks/CriticalsHack.java +++ b/src/main/java/net/wurstclient/hacks/CriticalsHack.java @@ -8,6 +8,7 @@ package net.wurstclient.hacks; import net.minecraft.entity.LivingEntity; +import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; @@ -68,6 +69,10 @@ public void doCritical() if(!isEnabled()) return; + if(WURST.getHax().maceDmgHack.isEnabled() + && MC.player.getMainHandStack().isOf(Items.MACE)) + return; + if(!MC.player.isOnGround()) return; diff --git a/src/main/java/net/wurstclient/hacks/MaceDmgHack.java b/src/main/java/net/wurstclient/hacks/MaceDmgHack.java new file mode 100644 index 0000000000..8ecf4b8e84 --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/MaceDmgHack.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.hacks; + +import net.minecraft.client.network.ClientPlayNetworkHandler; +import net.minecraft.item.Items; +import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket.PositionAndOnGround; +import net.minecraft.util.hit.HitResult; +import net.wurstclient.Category; +import net.wurstclient.SearchTags; +import net.wurstclient.events.LeftClickListener; +import net.wurstclient.hack.Hack; + +@SearchTags({"mace dmg", "MaceDamage", "mace damage"}) +public final class MaceDmgHack extends Hack implements LeftClickListener +{ + public MaceDmgHack() + { + super("MaceDMG"); + setCategory(Category.COMBAT); + } + + @Override + protected void onEnable() + { + EVENTS.add(LeftClickListener.class, this); + } + + @Override + protected void onDisable() + { + EVENTS.remove(LeftClickListener.class, this); + } + + @Override + public void onLeftClick(LeftClickEvent event) + { + if(MC.crosshairTarget == null + || MC.crosshairTarget.getType() != HitResult.Type.ENTITY) + return; + + if(!MC.player.getMainHandStack().isOf(Items.MACE)) + return; + + // See ServerPlayNetworkHandler.onPlayerMove() + // for why it's using these numbers. + // Also, let me know if you find a way to bypass that check in 1.21. + for(int i = 0; i < 4; i++) + sendFakeY(0); + sendFakeY(Math.sqrt(500)); + sendFakeY(0); + } + + private void sendFakeY(double offset) + { + ClientPlayNetworkHandler netHandler = MC.player.networkHandler; + double posX = MC.player.getX(); + double posY = MC.player.getY(); + double posZ = MC.player.getZ(); + + netHandler.sendPacket( + new PositionAndOnGround(posX, posY + offset, posZ, false)); + } +} diff --git a/src/main/resources/assets/wurst/lang/en_us.json b/src/main/resources/assets/wurst/lang/en_us.json index 5610cbea84..677edaa2b4 100644 --- a/src/main/resources/assets/wurst/lang/en_us.json +++ b/src/main/resources/assets/wurst/lang/en_us.json @@ -133,6 +133,7 @@ "description.wurst.hack.killpotion": "Generates a potion that can kill almost anything, including players in Creative mode. Does not work on undead mobs, since they are already dead.\n\nRequires Creative mode.", "description.wurst.hack.liquids": "Allows you to place blocks in liquids.", "description.wurst.hack.lsd": "Causes hallucinations.", + "description.wurst.hack.macedmg": "Increases your damage when attacking with a mace.", "description.wurst.hack.masstpa": "Sends a TPA request to all players.", "description.wurst.hack.mileycyrus": "Makes you twerk.", "description.wurst.hack.mobesp": "Highlights nearby mobs.",