Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.TNT_Block_Unkown.commands.list;
- import de.TNT_Block_Unkown.commands.Command;
- import net.minecraft.client.Minecraft;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.network.play.client.C10PacketCreativeInventoryAction;
- import net.minecraft.util.ResourceLocation;
- public class BugItem extends Command{
- public BugItem() {
- super("bugitem", "man glitch durch den boden lol");
- // TODO Auto-generated constructor stub
- }
- @Override
- public void onBefehl(String[] args) {
- String block = args[0];
- Item crashitem = getItem(new ResourceLocation(block));
- //itemstack
- ItemStack itm = new ItemStack(crashitem);
- //hide flags
- NBTTagCompound base = new NBTTagCompound();
- base.setByte("HideFlags", (byte) 63);
- //glitchtag
- NBTTagList attributeModifiers = new NBTTagList();
- NBTTagCompound glitch = new NBTTagCompound();
- glitch.setDouble("Amount", Double.NaN);
- glitch.setString("AttributeName", "generic.movementSpeed");
- glitch.setString("Name", "GetRektM8");
- glitch.setInteger("Operation", 0);
- glitch.setString("Slot", "mainhand");
- glitch.setInteger("UUIDLeast", 1);
- glitch.setInteger("UUIDMost", 1);
- //set tags
- attributeModifiers.appendTag(glitch);
- base.setTag("AttributeModifiers",attributeModifiers);
- itm.setTagCompound(base);
- giveItem(itm);
- }
- public static Item getItem(ResourceLocation loc) {
- return (Item)Item.itemRegistry.getObject(loc);
- }
- public static void giveItem(ItemStack stack) {
- Integer errorint = 0;
- for (int i = 0; i < 9; i++) {
- if (Minecraft.getMinecraft().thePlayer.inventory.getStackInSlot(i) == null)
- {
- Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C10PacketCreativeInventoryAction(36 + i, stack));
- return;
- }else {
- if (errorint==8) {
- sendMessage("Bitte mache deine Schnellzugriffsleiste frei!");
- }else {
- errorint = errorint + 1;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement