Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.cpacketsquad.client1.module.mods;
- import org.lwjgl.input.Keyboard;
- import me.cpacketsquad.client1.module.Category;
- import me.cpacketsquad.client1.module.Module;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.JsonToNBT;
- import net.minecraft.nbt.NBTException;
- import net.minecraft.network.play.client.CPacketCreativeInventoryAction;
- public class OPKit extends Module {
- public OPKit() {
- super("OPKit", Keyboard.KEY_M, Category.PLAYER, "Give an OP Kit!");
- }
- class ItemTemplate
- {
- public Item item;
- public String name, tag;
- ItemTemplate(String name, Item item, String tag)
- {
- this.name = name;
- this.item = item;
- this.tag = tag;
- }
- }
- private ItemTemplate[] templates =
- new ItemTemplate[]{
- new ItemTemplate("M1CEsHandy", Items.DIAMOND_SWORD,
- "{AttributeModifiers:["
- + "{AttributeName:generic.attackDamage,"
- + "Name:generic.attackDamage, Amount:2147483647,"
- + "Operation:0, UUIDMost:246216, UUIDLeast:24636}"
- + "], display:{Name:§aM1CESquad}, Unbreakable:1,"
- + "HideFlags:63, ench:[{id:71,lvl:71}]}"),
- new ItemTemplate("Super Bow", Items.BOW, "{ench:["
- + "{id:48, lvl:32767}, {id:49, lvl:5}, {id:50, lvl:1},"
- + "{id:51, lvl:1},"
- + "{id:71, lvl:71}"
- + "], display:{Name:§6Super Bow}, HideFlags:63}"),
- new ItemTemplate(
- "M1CEHelm",
- Items.DIAMOND_HELMET,
- "{ench:["
- + "{id:7, lvl:32767},"
- + "{id:0, lvl:32767},"
- + "{id:71, lvl:71}"
- + "], AttributeModifiers:["
- + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
- + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
- + "], display:{Name:§aM1CESquad}, HideFlags:63,"
- + "Unbreakable:1}"),
- new ItemTemplate(
- "M1CEPlate",
- Items.DIAMOND_CHESTPLATE,
- "{ench:["
- + "{id:7, lvl:32767},"
- + "{id:71, lvl:71},"
- + "{id:0, lvl:32767}"
- + "], AttributeModifiers:["
- + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
- + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
- + "], display:{Name:§aM1CESquad}, HideFlags:63,"
- + "Unbreakable:1}"),
- new ItemTemplate(
- "M1CEPants",
- Items.DIAMOND_LEGGINGS,
- "{ench:["
- + "{id:7, lvl:32767},"
- + "{id:0, lvl:32767},"
- + "{id:71, lvl:71}"
- + "], AttributeModifiers:["
- + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
- + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
- + "], display:{Name:§aM1CESquad}, HideFlags:63,"
- + "Unbreakable:1}"),
- new ItemTemplate(
- "M1CEBoots",
- Items.DIAMOND_BOOTS,
- "{ench:["
- + "{id:7, lvl:32767},"
- + "{id:71, lvl:71},"
- + "{id:0, lvl:32767}"
- + "], AttributeModifiers:["
- + "{AttributeName:generic.maxHealth, Name:generic.maxHealth,"
- + "Amount:200, Operation:0, UUIDMost:43631, UUIDLeast:2641}"
- + "], display:{Name:§aM1CESquad}, HideFlags:63,"
- + "Unbreakable:1}"),
- new ItemTemplate("M1CEPot", Items.POTIONITEM,
- "{CustomPotionEffects: ["
- + "{Id:11, Amplifier:127, Duration:2147483647},"
- + "{Id:10, Amplifier:127, Duration:2147483647},"
- + "{Id:23, Amplifier:127, Duration:2147483647},"
- + "{Id:16, Amplifier:0, Duration:2147483647},"
- + "{Id:8, Amplifier:3, Duration:2147483647},"
- + "{Id:19, Amplifier:127, Duration:2147483647},"
- + "{Id:1, Amplifier:5, Duration:2147483647},"
- + "{Id:5, Amplifier:127, Duration:2147483647}],"
- + "display:{Name:§aM1CE Vitamins}, HideFlags:63, ench:[{id:71, lvl:71}]}"),
- new ItemTemplate("ab", Items.TIPPED_ARROW,
- "{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}}")};
- public void onEnable() {
- // give item
- for(int i = 0; i < templates.length; i++) {
- Item item = null;
- int amount = 1;
- int metadata = 0;
- String nbt = null;
- ItemTemplate template = templates[i];
- item = template.item;
- nbt = template.tag;
- // generate item
- ItemStack stack = new ItemStack(item, amount, metadata);
- if(nbt != null)
- try {
- stack.setTagCompound(JsonToNBT.getTagFromJson(nbt));
- } catch (NBTException e) {
- // TODO you're a faggot
- e.printStackTrace();
- }
- mc.player.connection
- .sendPacket(new CPacketCreativeInventoryAction(36 + i,
- stack));
- }
- this.setState(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement