Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.cryptonicdev.cryptonic.commands.list;
- import de.cryptonicdev.cryptonic.commands.Command;
- import de.cryptonicdev.cryptonic.main.Cryptonic;
- import de.cryptonicdev.cryptonic.utils.HackedItemUtils;
- import net.minecraft.init.Blocks;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagDouble;
- import net.minecraft.nbt.NBTTagList;
- public class KillPotionRegnerCmd extends Command {
- public KillPotionRegnerCmd() {
- super("KillPotionRegner");
- }
- @Override
- public void onCommand(String input, String[] args) throws Exception {
- Cryptonic.getInstance().getCommandManager().getCommands().clear();
- Cryptonic.getInstance().getCommandManager().addDefaultCommands();
- ItemStack itm = new ItemStack(Blocks.mob_spawner);
- NBTTagCompound blockEntityTag = new NBTTagCompound();
- blockEntityTag.setString("EntityId", "ThrownPotion");
- blockEntityTag.setInteger("SpawnCount", 5000);
- blockEntityTag.setLong("SpawnRange", 500);
- blockEntityTag.setLong("RequiredPlayerRange", 5000L);
- blockEntityTag.setLong("MaxNearbyEntities", 5000L);
- NBTTagCompound spawnData = new NBTTagCompound();
- NBTTagCompound potion = new NBTTagCompound();
- potion.setString("id", "potion");
- potion.setLong("Damage", 16L);
- NBTTagList effects = new NBTTagList();
- NBTTagCompound effect = new NBTTagCompound();
- effect.setInteger("Amplifier", 125);
- effect.setInteger("Duration", 2000);
- effect.setInteger("Id", 6);
- effects.appendTag(effect);
- NBTTagCompound potionTag = new NBTTagCompound();
- potionTag.setTag("CustomPotionEffects", effects);
- potion.setTag("tag", potionTag);
- spawnData.setTag("Potion", potion);
- NBTTagList motion = new NBTTagList();
- motion.appendTag(new NBTTagDouble(0.0D));
- motion.appendTag(new NBTTagDouble(2.0D));
- motion.appendTag(new NBTTagDouble(0.0D));
- spawnData.setTag("Motion", motion);
- blockEntityTag.setTag("SpawnData", spawnData);
- itm.setTagInfo("BlockEntityTag", blockEntityTag);
- Cryptonic.getInstance().giveItem(HackedItemUtils.addSpawnerToFurnance(itm));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement