Advertisement
Guest User

Untitled

a guest
May 27th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.63 KB | None | 0 0
  1. package me.cpacketsquad.client1.module.mods;
  2.  
  3. import org.lwjgl.input.Keyboard;
  4.  
  5. import me.cpacketsquad.client1.module.Category;
  6. import me.cpacketsquad.client1.module.Module;
  7. import net.minecraft.init.Items;
  8. import net.minecraft.item.Item;
  9. import net.minecraft.item.ItemStack;
  10. import net.minecraft.nbt.JsonToNBT;
  11. import net.minecraft.nbt.NBTException;
  12. import net.minecraft.network.play.client.CPacketCreativeInventoryAction;
  13.  
  14. public class OPKit extends Module {
  15. public OPKit() {
  16. super("OPKit", Keyboard.KEY_M, Category.PLAYER, "Give an OP Kit!");
  17. }
  18. class ItemTemplate
  19. {
  20. public Item item;
  21. public String name, tag;
  22.  
  23. ItemTemplate(String name, Item item, String tag)
  24. {
  25. this.name = name;
  26. this.item = item;
  27. this.tag = tag;
  28. }
  29. }
  30.  
  31. private ItemTemplate[] templates =
  32. new ItemTemplate[]{
  33. new ItemTemplate("M1CEsHandy", Items.DIAMOND_SWORD,
  34. "{AttributeModifiers:["
  35. + "{AttributeName:generic.attackDamage,"
  36. + "Name:generic.attackDamage, Amount:2147483647,"
  37. + "Operation:0, UUIDMost:246216, UUIDLeast:24636}"
  38. + "], display:{Name:§aM1CESquad}, Unbreakable:1,"
  39. + "HideFlags:63, ench:[{id:71,lvl:71}]}"),
  40.  
  41. new ItemTemplate("Super Bow", Items.BOW, "{ench:["
  42. + "{id:48, lvl:32767}, {id:49, lvl:5}, {id:50, lvl:1},"
  43. + "{id:51, lvl:1},"
  44. + "{id:71, lvl:71}"
  45. + "], display:{Name:§6Super Bow}, HideFlags:63}"),
  46.  
  47. new ItemTemplate(
  48. "M1CEHelm",
  49. Items.DIAMOND_HELMET,
  50. "{ench:["
  51. + "{id:7, lvl:32767},"
  52. + "{id:0, lvl:32767},"
  53. + "{id:71, lvl:71}"
  54. + "], AttributeModifiers:["
  55. + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
  56. + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
  57. + "], display:{Name:§aM1CESquad}, HideFlags:63,"
  58. + "Unbreakable:1}"),
  59. new ItemTemplate(
  60. "M1CEPlate",
  61. Items.DIAMOND_CHESTPLATE,
  62. "{ench:["
  63. + "{id:7, lvl:32767},"
  64. + "{id:71, lvl:71},"
  65. + "{id:0, lvl:32767}"
  66. + "], AttributeModifiers:["
  67. + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
  68. + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
  69. + "], display:{Name:§aM1CESquad}, HideFlags:63,"
  70. + "Unbreakable:1}"),
  71. new ItemTemplate(
  72. "M1CEPants",
  73. Items.DIAMOND_LEGGINGS,
  74. "{ench:["
  75. + "{id:7, lvl:32767},"
  76. + "{id:0, lvl:32767},"
  77. + "{id:71, lvl:71}"
  78. + "], AttributeModifiers:["
  79. + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
  80. + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
  81. + "], display:{Name:§aM1CESquad}, HideFlags:63,"
  82. + "Unbreakable:1}"),
  83. new ItemTemplate(
  84. "M1CEBoots",
  85. Items.DIAMOND_BOOTS,
  86. "{ench:["
  87. + "{id:7, lvl:32767},"
  88. + "{id:71, lvl:71},"
  89. + "{id:0, lvl:32767}"
  90. + "], AttributeModifiers:["
  91. + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
  92. + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
  93. + "], display:{Name:§aM1CESquad}, HideFlags:63,"
  94. + "Unbreakable:1}"),
  95. new ItemTemplate("M1CEPot", Items.POTIONITEM,
  96. "{CustomPotionEffects: ["
  97. + "{Id:11, Amplifier:127, Duration:2147483647},"
  98. + "{Id:10, Amplifier:127, Duration:2147483647},"
  99. + "{Id:23, Amplifier:127, Duration:2147483647},"
  100. + "{Id:16, Amplifier:0, Duration:2147483647},"
  101. + "{Id:8, Amplifier:3, Duration:2147483647},"
  102. + "{Id:19, Amplifier:127, Duration:2147483647},"
  103. + "{Id:1, Amplifier:5, Duration:2147483647},"
  104. + "{Id:5, Amplifier:127, Duration:2147483647}],"
  105. + "display:{Name:§aM1CE Vitamins}, HideFlags:63, ench:[{id:71, lvl:71}]}"),
  106. new ItemTemplate("ab", Items.TIPPED_ARROW,
  107. "{CustomPotionEffects:[{Id:6,Amplifier:-127,Duration:76957140},{Id:7,Amplifier:126,Duration:76957140},{Id:9,Amplifier:2,Duration:300},{Id:11,Amplifier:1,Duration:76957140},{Id:15,Amplifier:1,Duration:100},{Id:18,Amplifier:127,Duration:240},{Id:21,Amplifier:-127,Duration:600}],display:{Name:Super Potion}}")};
  108. public void onEnable() {
  109. // give item
  110. for(int i = 0; i < templates.length; i++) {
  111. Item item = null;
  112. int amount = 1;
  113. int metadata = 0;
  114. String nbt = null;
  115.  
  116. ItemTemplate template = templates[i];
  117. item = template.item;
  118. nbt = template.tag;
  119. // generate item
  120. ItemStack stack = new ItemStack(item, amount, metadata);
  121. if(nbt != null)
  122. try {
  123. stack.setTagCompound(JsonToNBT.getTagFromJson(nbt));
  124. } catch (NBTException e) {
  125. // TODO you're a faggot
  126. e.printStackTrace();
  127. }
  128.  
  129. mc.player.connection
  130. .sendPacket(new CPacketCreativeInventoryAction(36 + i,
  131. stack));
  132. }
  133. this.setState(false);
  134. }
  135. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement