Skip to content

Commit

Permalink
Add MaceDmgHack
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Jun 28, 2024
1 parent 76ec389 commit bffead6
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/net/wurstclient/hack/HackList.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/net/wurstclient/hacks/CriticalsHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
69 changes: 69 additions & 0 deletions src/main/java/net/wurstclient/hacks/MaceDmgHack.java
Original file line number Diff line number Diff line change
@@ -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));
}
}
1 change: 1 addition & 0 deletions src/main/resources/assets/wurst/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit bffead6

Please sign in to comment.