Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. /*
  2. Made by Garkolym 21.06.2018
  3. Dieser kleine Code Ausschnitt soll Dir als Hacked Client Entwickler helfen, diese Funktion zu implementieren.
  4. Minecraft Version 1.12.0
  5. */
  6.  
  7. package de.Garkolym;
  8.  
  9. import de.izemod.addon.iZe_Addon;
  10. import net.minecraft.client.Minecraft;
  11. import net.minecraft.util.EnumHand;
  12.  
  13. public class Duplizierer extends iZe_Addon {
  14.  
  15. private boolean aktiviert = false;
  16. private boolean mustHit = false;
  17. private int ticks = 0;
  18.  
  19. private int hitticks = 21;
  20.  
  21. @Override
  22. public boolean onCommand(String command, String[] args) {
  23. if (command.equalsIgnoreCase("dupe")) {
  24. if (args.length == 1) {
  25. try {
  26. this.hitticks = Integer.valueOf(args[0]);
  27. getChat().printChatMessageWithPrefix("§aDie Ticks wurden erfolgreich gesetzt!!");
  28. } catch (Exception e) {
  29.  
  30. }
  31. } else {
  32. aktiviert = !aktiviert;
  33. if (aktiviert) {
  34. getChat().printChatMessageWithPrefix("§aDer Dupe Hack wurde aktiviert!");
  35. } else {
  36. getChat().printChatMessageWithPrefix("§4Der Dupe Hack wurde deaktiviert!");
  37. }
  38. }
  39. }
  40. return true;
  41. }
  42.  
  43. @Override
  44. public boolean onRightMouseButtonClick() {
  45. if (Minecraft.getMinecraft().player != null && this.aktiviert) {
  46. if (Minecraft.getMinecraft().world.getBlockState(Minecraft.getMinecraft().objectMouseOver.getBlockPos())
  47. .getBlock().getUnlocalizedName().equalsIgnoreCase("tile.button")) {
  48.  
  49. this.mustHit = true;
  50. this.ticks = hitticks;
  51. }
  52.  
  53. }
  54. return super.onRightMouseButtonClick();
  55. }
  56.  
  57. @Override
  58. public void onTick() {
  59. if (this.aktiviert) {
  60. if (this.mustHit && ticks == 0) {
  61. this.mustHit = false;
  62. for (int i = 0; i < 50; i++) {
  63. Minecraft.getMinecraft().playerController.attackEntity(Minecraft.getMinecraft().player,
  64. Minecraft.getMinecraft().objectMouseOver.entityHit);
  65. Minecraft.getMinecraft().player.swingArm(EnumHand.MAIN_HAND);
  66. }
  67. getChat().printChatMessageWithPrefix("Das Item wurde geschlagen!");
  68. }
  69. if (this.mustHit && ticks > 0) {
  70. ticks--;
  71. }
  72. }
  73. }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement