added criticals

This commit is contained in:
Bella 2019-11-23 22:29:53 -05:00
parent 1e6fc5e382
commit c02b0e7420
1 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package me.zeroeightsix.kami.module.modules.sdashb.combat;
import java.util.function.Predicate;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.CPacketPlayer;
import me.zero.alpine.listener.EventHandler;
import net.minecraftforge.event.entity.player.AttackEntityEvent;
import me.zero.alpine.listener.Listener;
import me.zeroeightsix.kami.module.Module;
@Module.Info(name = "Criticals", category = Module.Category.COMBAT, description = "Automatically does critical attacks")
public class Criticals extends Module
{
@EventHandler
private Listener<AttackEntityEvent> attackEntityEventListener;
public Criticals() {
this.attackEntityEventListener = new Listener<AttackEntityEvent>(event -> {
if (!Criticals.mc.player.isInWater() && !Criticals.mc.player.isInLava()) {
if (Criticals.mc.player.onGround) {
Criticals.mc.player.connection.sendPacket((Packet)new CPacketPlayer.Position(Criticals.mc.player.posX, Criticals.mc.player.posY + 0.1625, Criticals.mc.player.posZ, false));
Criticals.mc.player.connection.sendPacket((Packet)new CPacketPlayer.Position(Criticals.mc.player.posX, Criticals.mc.player.posY, Criticals.mc.player.posZ, false));
Criticals.mc.player.connection.sendPacket((Packet)new CPacketPlayer.Position(Criticals.mc.player.posX, Criticals.mc.player.posY + 4.0E-6, Criticals.mc.player.posZ, false));
Criticals.mc.player.connection.sendPacket((Packet)new CPacketPlayer.Position(Criticals.mc.player.posX, Criticals.mc.player.posY, Criticals.mc.player.posZ, false));
Criticals.mc.player.connection.sendPacket((Packet)new CPacketPlayer.Position(Criticals.mc.player.posX, Criticals.mc.player.posY + 1.0E-6, Criticals.mc.player.posZ, false));
Criticals.mc.player.connection.sendPacket((Packet)new CPacketPlayer.Position(Criticals.mc.player.posX, Criticals.mc.player.posY, Criticals.mc.player.posZ, false));
Criticals.mc.player.connection.sendPacket((Packet)new CPacketPlayer());
Criticals.mc.player.onCriticalHit(event.getTarget());
}
}
}, (Predicate<AttackEntityEvent>[])new Predicate[0]);
}
}