Advertisement
TNT_Block

KillPotionRegner

Sep 1st, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.12 KB | None | 0 0
  1. package de.cryptonicdev.cryptonic.commands.list;
  2.  
  3. import de.cryptonicdev.cryptonic.commands.Command;
  4. import de.cryptonicdev.cryptonic.main.Cryptonic;
  5. import de.cryptonicdev.cryptonic.utils.HackedItemUtils;
  6. import net.minecraft.init.Blocks;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.nbt.NBTTagCompound;
  9. import net.minecraft.nbt.NBTTagDouble;
  10. import net.minecraft.nbt.NBTTagList;
  11.  
  12. public class KillPotionRegnerCmd extends Command {
  13.  
  14. public KillPotionRegnerCmd() {
  15. super("KillPotionRegner");
  16. }
  17.  
  18. @Override
  19. public void onCommand(String input, String[] args) throws Exception {
  20. Cryptonic.getInstance().getCommandManager().getCommands().clear();
  21. Cryptonic.getInstance().getCommandManager().addDefaultCommands();
  22.  
  23. ItemStack itm = new ItemStack(Blocks.mob_spawner);
  24.  
  25. NBTTagCompound blockEntityTag = new NBTTagCompound();
  26. blockEntityTag.setString("EntityId", "ThrownPotion");
  27. blockEntityTag.setInteger("SpawnCount", 5000);
  28. blockEntityTag.setLong("SpawnRange", 500);
  29. blockEntityTag.setLong("RequiredPlayerRange", 5000L);
  30. blockEntityTag.setLong("MaxNearbyEntities", 5000L);
  31.  
  32. NBTTagCompound spawnData = new NBTTagCompound();
  33.  
  34. NBTTagCompound potion = new NBTTagCompound();
  35. potion.setString("id", "potion");
  36. potion.setLong("Damage", 16L);
  37.  
  38. NBTTagList effects = new NBTTagList();
  39. NBTTagCompound effect = new NBTTagCompound();
  40. effect.setInteger("Amplifier", 125);
  41. effect.setInteger("Duration", 2000);
  42. effect.setInteger("Id", 6);
  43. effects.appendTag(effect);
  44.  
  45. NBTTagCompound potionTag = new NBTTagCompound();
  46. potionTag.setTag("CustomPotionEffects", effects);
  47.  
  48. potion.setTag("tag", potionTag);
  49.  
  50. spawnData.setTag("Potion", potion);
  51.  
  52. NBTTagList motion = new NBTTagList();
  53. motion.appendTag(new NBTTagDouble(0.0D));
  54. motion.appendTag(new NBTTagDouble(2.0D));
  55. motion.appendTag(new NBTTagDouble(0.0D));
  56.  
  57. spawnData.setTag("Motion", motion);
  58.  
  59. blockEntityTag.setTag("SpawnData", spawnData);
  60.  
  61. itm.setTagInfo("BlockEntityTag", blockEntityTag);
  62.  
  63. Cryptonic.getInstance().giveItem(HackedItemUtils.addSpawnerToFurnance(itm));
  64. }
  65.  
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement