TNT_Block

PlanetSpawner-Hack minecraft

Feb 24th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.25 KB | None | 0 0
  1. package de.TNT_Block_Unkown;
  2.  
  3. import net.minecraft.client.Minecraft;
  4. import net.minecraft.init.Blocks;
  5. import net.minecraft.item.ItemStack;
  6. import net.minecraft.nbt.JsonToNBT;
  7. import net.minecraft.nbt.NBTException;
  8. import net.minecraft.nbt.NBTTagCompound;
  9. import net.minecraft.nbt.NBTTagList;
  10. import net.minecraft.network.play.client.C10PacketCreativeInventoryAction;
  11.  
  12. public class planetspawner {
  13. public static ItemStack itm = new ItemStack(Blocks.mob_spawner,1,0);
  14. public static void execute(Integer radius) throws NBTException {
  15. NBTTagCompound base = new NBTTagCompound();
  16. NBTTagCompound BlockEntityTag = new NBTTagCompound();
  17. NBTTagCompound SpawnData = new NBTTagCompound();
  18. NBTTagList equipment = new NBTTagList();
  19. BlockEntityTag.setInteger("SpawnCount", 40);
  20. BlockEntityTag.setInteger("SpawnRange", radius);
  21. BlockEntityTag.setInteger("RequiredPlayerRange", 6);
  22. BlockEntityTag.setInteger("MaxNearbyEntities", 10);
  23. BlockEntityTag.setInteger("MinSpawnDelay", 2);
  24. BlockEntityTag.setInteger("MaxSpawnDelay", 4);
  25. BlockEntityTag.setString("EntityId", "ArmorStand");
  26. SpawnData.setInteger("Invisible", 1);
  27. SpawnData.setInteger("Invulnerable", 1);
  28. SpawnData.setInteger("NoBasePlate", 1);
  29. SpawnData.setInteger("NoGravity", 1);
  30. equipment.appendTag(JsonToNBT.func_180713_a("{}"));
  31. equipment.appendTag(JsonToNBT.func_180713_a("{}"));
  32. equipment.appendTag(JsonToNBT.func_180713_a("{}"));
  33. equipment.appendTag(JsonToNBT.func_180713_a("{}"));
  34. equipment.appendTag(JsonToNBT.func_180713_a("{id:\"skull\",Count:1b,Damage:3b,tag:{SkullOwner:{Id:\"0ceac85e-159d-4f9d-a1c2-c8acde792f23\",Properties:{textures:[{Value:\"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYjFkZDRmZTRhNDI5YWJkNjY1ZGZkYjNlMjEzMjFkNmVmYTZhNmI1ZTdiOTU2ZGI5YzVkNTljOWVmYWIyNSJ9fX0=\"}]}}}}"));
  35. SpawnData.setTag("Equipment", equipment);
  36. BlockEntityTag.setTag("SpawnData", SpawnData);
  37. base.setTag("BlockEntityTag", BlockEntityTag);
  38. itm.setTagCompound(base);
  39. Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C10PacketCreativeInventoryAction(36,addSpawnerToFurnance(itm)));
  40. }
  41. public static ItemStack addSpawnerToFurnance(ItemStack itemStack) {
  42. ItemStack itm = new ItemStack(Blocks.furnace);
  43. NBTTagCompound base = new NBTTagCompound();
  44. NBTTagCompound blockEntityTag = new NBTTagCompound();
  45. blockEntityTag.setShort("BurnTime", (short) 0);
  46. blockEntityTag.setShort("CookTime", (short) 0);
  47. blockEntityTag.setShort("CookTimeTotal", (short) 200);
  48. blockEntityTag.setString("id", "Furnance");
  49. blockEntityTag.setString("Lock", "");
  50. NBTTagList itemList = new NBTTagList();
  51. NBTTagCompound currentItem = new NBTTagCompound();
  52. currentItem.setByte("Count", (byte) 1);
  53. currentItem.setShort("Damage", (short) itemStack.getItemDamage());
  54. currentItem.setString("id", "minecraft:mob_spawner");
  55. currentItem.setShort("Slot", (byte) 0);
  56. currentItem.setTag("tag", itemStack.getTagCompound());
  57. itemList.appendTag(currentItem);
  58. blockEntityTag.setTag("Items", itemList);
  59. base.setTag("BlockEntityTag", blockEntityTag);
  60. itm.setTagCompound(base);
  61. return itm;
  62. }
  63. }
Add Comment
Please, Sign In to add comment