Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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.getCurrentArmor(0) != null ){
- ItemStack boots = player.getCurrentArmor(0);
- if(boots.getItem() == SoulCraft.soulBoots) bootsOn = true;
- }
- if(player.getCurrentArmor(1) != null ){
- ItemStack legs = player.getCurrentArmor(1);
- if(legs.getItem() == SoulCraft.soulLeggings) legsOn = true;
- }
- if(player.getCurrentArmor(2) != null ){
- ItemStack chest = player.getCurrentArmor(2);
- if(chest.getItem() == SoulCraft.soulChest) chestOn = true;
- }
- if(player.getCurrentArmor(3) != null ){
- ItemStack helm = player.getCurrentArmor(3);
- if(helm.getItem() == SoulCraft.soulHelmet) helmOn = 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