Advertisement
Guest User

Untitled

a guest
May 21st, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. @EventTarget
  2. public void onPacketSent(EventSendPacket e) {
  3. String crit = Nightcore.instance.setmgr.getSettingByName("CritMode").getValString();
  4. if(crit.equalsIgnoreCase("Packet")) {
  5. this.setDisplayname("Criticals §7Packet");
  6. if (e.getPacket() instanceof C02PacketUseEntity) {
  7. C02PacketUseEntity packetUseEntity = (C02PacketUseEntity) e.getPacket();
  8. if (packetUseEntity.getAction() == C02PacketUseEntity.Action.ATTACK) {
  9. EntityLivingBase ent = (EntityLivingBase) packetUseEntity.getEntityFromWorld(mc.theWorld);
  10. if(Nightcore.instance.moduleManager.getModuleByName("Killaura").isEnabled() && !Nightcore.instance.moduleManager.getModuleByName("Speed").isEnabled()&& !Nightcore.instance.moduleManager.getModuleByName("Fly").isEnabled()) {
  11. if(mc.thePlayer.onGround && timer.hasReached(500L) && mc.thePlayer.ticksExisted % 4 == 0 && mc.thePlayer.getDistanceToEntity(ent) <= 3.8) {
  12. messageWithoutPrefix("§3[§bDEBUG§3] §fCritical " + MathUtil.getRandomInRange(1, 99));
  13. if(canCrit == true) {
  14. canCrit = false;
  15. } else {
  16. canCrit = true;
  17. }
  18. sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, false));
  19. try {
  20. 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));
  21. sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY + 0, this.mc.thePlayer.posZ, false));
  22. }catch(Exception v) {}
  23. sendPacket(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, false));
  24. timer.reset();
  25. }
  26. }
  27. }
  28. }
  29. }
  30. }
  31. public static void messageWithPrefix(String msg) {
  32. messageWithoutPrefix(Nightcore.instance.Client_Preifx + msg);
  33. }
  34.  
  35. public static void messageWithoutPrefix(String msg) {
  36. Object chat = new ChatComponentText(msg);
  37. if(msg != null) {
  38. Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage((IChatComponent)chat);
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement