Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer player, EntityLivingBase target)
- {
- if (target instanceof EntityLostSoulMob) {
- int i = (int)player.posX;
- int j = (int)player.posY;
- int k = (int)player.posZ;
- World world = player.worldObj;
- boolean helmOn = false;
- boolean chestOn = false;
- boolean legsOn = false;
- boolean bootsOn = false;
- if (player.inventory.armorInventory[0] != null )
- if(player.inventory.armorInventory[0] == new ItemStack(SoulCraft.soulHelmet))
- helmOn = true;
- if (player.inventory.armorInventory[1] != null )
- if(player.inventory.armorInventory[1] == new ItemStack(SoulCraft.soulChest))
- chestOn = true;
- if (player.inventory.armorInventory[2] != null )
- if(player.inventory.armorInventory[2] == new ItemStack(SoulCraft.soulLeggings))
- legsOn = true;
- if (player.inventory.armorInventory[3] != null )
- if(player.inventory.armorInventory[3] == new ItemStack(SoulCraft.soulBoots))
- bootsOn = true;
- if(helmOn && chestOn && legsOn && bootsOn) {
- world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
- player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(SoulCraft.soulTrapLostSoul));
- target.setDead();
- }
- else {
- world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
- world.spawnEntityInWorld(new EntityLightningBolt(world, i + 2, j, k));
- world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k + 2));
- world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k - 2));
- world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k - 2));
- GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
- chat.printChatMessage(new ChatComponentText("Fool tried to capture a soul without proper Soul Armor"));
- }
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment