forked from RepoMirrors/kami-blue
added criticals
This commit is contained in:
parent
1e6fc5e382
commit
c02b0e7420
|
@ -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]);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue