Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventTarget
- public void onPacketSent(EventSendPacket e) {
- String crit = Nightcore.instance.setmgr.getSettingByName("CritMode").getValString();
- if(crit.equalsIgnoreCase("Packet")) {
- this.setDisplayname("Criticals §7Packet");
- if (e.getPacket() instanceof C02PacketUseEntity) {
- C02PacketUseEntity packetUseEntity = (C02PacketUseEntity) e.getPacket();
- if (packetUseEntity.getAction() == C02PacketUseEntity.Action.ATTACK) {
- EntityLivingBase ent = (EntityLivingBase) packetUseEntity.getEntityFromWorld(mc.theWorld);
- if(Nightcore.instance.moduleManager.getModuleByName("Killaura").isEnabled() && !Nightcore.instance.moduleManager.getModuleByName("Speed").isEnabled()&& !Nightcore.instance.moduleManager.getModuleByName("Fly").isEnabled()) {
- if(mc.thePlayer.onGround && timer.hasReached(500L) && mc.thePlayer.ticksExisted % 4 == 0 && mc.thePlayer.getDistanceToEntity(ent) <= 3.8) {
- messageWithoutPrefix("§3[§bDEBUG§3] §fCritical " + MathUtil.getRandomInRange(1, 99));
- if(canCrit == true) {
- canCrit = false;
- } else {
- canCrit = true;
- }
- sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, false));
- try {
- sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY + (canCrit == true ? 0.222345674884362 : 0.232345674884362) + MathUtil.getRandomInRange(0.02000000074505806, 0.03000000074505806), this.mc.thePlayer.posZ, false));
- sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY + 0, this.mc.thePlayer.posZ, false));
- }catch(Exception v) {}
- sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, false));
- timer.reset();
- }
- }
- }
- }
- }
- }
- public static void messageWithPrefix(String msg) {
- messageWithoutPrefix(Nightcore.instance.Client_Preifx + msg);
- }
- public static void messageWithoutPrefix(String msg) {
- Object chat = new ChatComponentText(msg);
- if(msg != null) {
- Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage((IChatComponent)chat);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement