Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.TNT_Block_Unkown;
- import net.minecraft.client.Minecraft;
- import net.minecraft.init.Blocks;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.JsonToNBT;
- import net.minecraft.nbt.NBTException;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.network.play.client.C10PacketCreativeInventoryAction;
- public class planetspawner {
- public static ItemStack itm = new ItemStack(Blocks.mob_spawner,1,0);
- public static void execute(Integer radius) throws NBTException {
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound BlockEntityTag = new NBTTagCompound();
- NBTTagCompound SpawnData = new NBTTagCompound();
- NBTTagList equipment = new NBTTagList();
- BlockEntityTag.setInteger("SpawnCount", 40);
- BlockEntityTag.setInteger("SpawnRange", radius);
- BlockEntityTag.setInteger("RequiredPlayerRange", 6);
- BlockEntityTag.setInteger("MaxNearbyEntities", 10);
- BlockEntityTag.setInteger("MinSpawnDelay", 2);
- BlockEntityTag.setInteger("MaxSpawnDelay", 4);
- BlockEntityTag.setString("EntityId", "ArmorStand");
- SpawnData.setInteger("Invisible", 1);
- SpawnData.setInteger("Invulnerable", 1);
- SpawnData.setInteger("NoBasePlate", 1);
- SpawnData.setInteger("NoGravity", 1);
- equipment.appendTag(JsonToNBT.func_180713_a("{}"));
- equipment.appendTag(JsonToNBT.func_180713_a("{}"));
- equipment.appendTag(JsonToNBT.func_180713_a("{}"));
- equipment.appendTag(JsonToNBT.func_180713_a("{}"));
- equipment.appendTag(JsonToNBT.func_180713_a("{id:\"skull\",Count:1b,Damage:3b,tag:{SkullOwner:{Id:\"0ceac85e-159d-4f9d-a1c2-c8acde792f23\",Properties:{textures:[{Value:\"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjFkZDRmZTRhNDI5YWJkNjY1ZGZkYjNlMjEzMjFkNmVmYTZhNmI1ZTdiOTU2ZGI5YzVkNTljOWVmYWIyNSJ9fX0=\"}]}}}}"));
- SpawnData.setTag("Equipment", equipment);
- BlockEntityTag.setTag("SpawnData", SpawnData);
- base.setTag("BlockEntityTag", BlockEntityTag);
- itm.setTagCompound(base);
- Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C10PacketCreativeInventoryAction(36,addSpawnerToFurnance(itm)));
- }
- public static ItemStack addSpawnerToFurnance(ItemStack itemStack) {
- ItemStack itm = new ItemStack(Blocks.furnace);
- NBTTagCompound base = new NBTTagCompound();
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setShort("BurnTime", (short) 0);
- blockEntityTag.setShort("CookTime", (short) 0);
- blockEntityTag.setShort("CookTimeTotal", (short) 200);
- blockEntityTag.setString("id", "Furnance");
- blockEntityTag.setString("Lock", "");
- NBTTagList itemList = new NBTTagList();
- NBTTagCompound currentItem = new NBTTagCompound();
- currentItem.setByte("Count", (byte) 1);
- currentItem.setShort("Damage", (short) itemStack.getItemDamage());
- currentItem.setString("id", "minecraft:mob_spawner");
- currentItem.setShort("Slot", (byte) 0);
- currentItem.setTag("tag", itemStack.getTagCompound());
- itemList.appendTag(currentItem);
- blockEntityTag.setTag("Items", itemList);
- base.setTag("BlockEntityTag", blockEntityTag);
- itm.setTagCompound(base);
- return itm;
- }
- }
Add Comment
Please, Sign In to add comment