Skip to content
This repository has been archived by the owner on Oct 27, 2023. It is now read-only.

Commit

Permalink
AntiShield
Browse files Browse the repository at this point in the history
  • Loading branch information
Nxyi committed Jun 1, 2023
1 parent 62a11f2 commit c0d6de6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ private static void initInner() {
registerModule(StorageVoider.class);
registerModule(BedBreaker.class);
registerModule(AutoTPA.class);
registerModule(AntiShield.class);

rebuildSharedModuleList();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package coffee.client.feature.module.impl.combat;

import coffee.client.feature.module.Module;
import coffee.client.feature.module.ModuleType;
import coffee.client.helper.event.impl.RenderEvent;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.Vec3d;

public class AntiShield extends Module {
public AntiShield() {
super("AntiShield", "Bypass shield by teleporting behind the player", ModuleType.COMBAT);
}

@Override
public void tick() {

}

@Override
public void onFastTick(){
if (client.options.attackKey.isPressed()){
if (client.targetedEntity != null){
Entity target = client.targetedEntity;
Vec3d ogpos = client.player.getPos();
backtp();
client.interactionManager.attackEntity(client.player, target);
client.player.setPosition(ogpos);
}
}
}

@Override
public void enable() {

}

@Override
public void disable() {

}

@Override
public String getContext() {
return null;
}

@Override
public void onWorldRender(MatrixStack matrices) {

}

@Override
public void onHudRender() {

}

private void backtp(){
Entity target = client.targetedEntity;
if (target == null) {
toggle();
return;
}

Vec3d ppos = target.getPos();
assert client.player != null;
Vec3d tp = Vec3d.fromPolar(0, client.player.getYaw()).normalize().multiply(1);
client.player.setPosition(new Vec3d(ppos.x + tp.x, ppos.y, ppos.z + tp.z));
float yaw = client.player.getYaw();
client.player.setYaw(-yaw);
}
}

0 comments on commit c0d6de6

Please sign in to comment.