Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package somarani.soulcraft.mobboss;
- import org.omg.CORBA.PUBLIC_MEMBER;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import scala.annotation.varargs;
- import scala.reflect.internal.Trees.This;
- import somarani.soulcraft.common.SoulCraft;
- import net.minecraft.client.Minecraft;
- import net.minecraft.client.gui.GuiNewChat;
- import net.minecraft.enchantment.Enchantment;
- import net.minecraft.enchantment.EnchantmentHelper;
- import net.minecraft.entity.Entity;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.IRangedAttackMob;
- import net.minecraft.entity.SharedMonsterAttributes;
- import net.minecraft.entity.ai.EntityAIArrowAttack;
- import net.minecraft.entity.ai.EntityAIAttackOnCollide;
- import net.minecraft.entity.ai.EntityAIFleeSun;
- import net.minecraft.entity.ai.EntityAIHurtByTarget;
- import net.minecraft.entity.ai.EntityAILookIdle;
- import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
- import net.minecraft.entity.ai.EntityAIRestrictSun;
- import net.minecraft.entity.ai.EntityAISwimming;
- import net.minecraft.entity.ai.EntityAIWander;
- import net.minecraft.entity.ai.EntityAIWatchClosest;
- import net.minecraft.entity.boss.BossStatus;
- import net.minecraft.entity.boss.IBossDisplayData;
- import net.minecraft.entity.effect.EntityLightningBolt;
- import net.minecraft.entity.monster.EntityCreeper;
- import net.minecraft.entity.monster.EntityMob;
- import net.minecraft.entity.monster.EntitySkeleton;
- import net.minecraft.entity.monster.EntitySpider;
- import net.minecraft.entity.monster.EntityZombie;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.entity.projectile.EntityArrow;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTBase;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagInt;
- import net.minecraft.util.ChatComponentText;
- import net.minecraft.util.DamageSource;
- import net.minecraft.util.MathHelper;
- import net.minecraft.world.EnumDifficulty;
- import net.minecraft.world.World;
- import net.minecraftforge.common.util.Constants.NBT;
- public class EntitySoulBossMob extends EntityMob implements IRangedAttackMob,
- IBossDisplayData {
- public static int count = 1000;
- public static int lightning = 0;
- public EntitySoulBossMob(World par1World) {
- super(par1World);
- this.stepHeight = 3f;
- }
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth)
- .setBaseValue(200d);
- }
- public void onLivingUpdate() {
- System.out.println("X: " + this.posX + ",Y:" + this.posY + ",Z:" + this.posZ );
- BossStatus.setBossStatus(this, true);
- EntityPlayer entityplayer = this.worldObj
- .getClosestVulnerablePlayerToEntity(this, 16.0D);
- if (entityplayer != null) {
- int x = (int) entityplayer.posX;
- int y = (int) entityplayer.posY;
- int z = (int) entityplayer.posZ;
- EntityCreeper creeper = new EntityCreeper(worldObj);
- EntitySkeleton skeleton = new EntitySkeleton(worldObj);
- EntitySpider spider = new EntitySpider(worldObj);
- EntityZombie zombie = new EntityZombie(worldObj);
- creeper.setPosition(x + 10, y + 10, z);
- skeleton.setPosition(this.posX, this.posY, this.posZ);
- spider.setPosition(x + 5, y, z + 5);
- zombie.setPosition(this.posX, this.posY, this.posZ);
- if (count > 169) {
- if (!worldObj.isRemote) {
- worldObj.spawnEntityInWorld(creeper);
- worldObj.spawnEntityInWorld(creeper);
- worldObj.spawnEntityInWorld(skeleton);
- worldObj.spawnEntityInWorld(skeleton);
- worldObj.spawnEntityInWorld(skeleton);
- worldObj.spawnEntityInWorld(spider);
- worldObj.spawnEntityInWorld(zombie);
- worldObj.spawnEntityInWorld(zombie);
- count = 0;
- }
- }
- else
- count++;
- }
- if (this.getHealth() == 0) {
- if (!worldObj.isRemote) {
- this.worldObj.spawnEntityInWorld(new EntityLightningBolt(
- this.worldObj, this.posX, this.posY, this.posZ));
- this.worldObj.spawnEntityInWorld(new EntityLightningBolt(
- this.worldObj, this.posX, this.posY, this.posZ));
- this.worldObj.spawnEntityInWorld(new EntityLightningBolt(
- this.worldObj, this.posX, this.posY, this.posZ));
- }
- }
- if (worldObj.difficultySetting == EnumDifficulty.PEACEFUL) {
- this.kill();
- }
- if (lightning >= 150) {
- if (entityplayer != null) {
- int x = (int) entityplayer.posX;
- int y = (int) entityplayer.posY;
- int z = (int) entityplayer.posZ;
- if (!worldObj.isRemote) {
- this.worldObj.spawnEntityInWorld(new EntityLightningBolt(
- this.worldObj, x + 3, y, z + 2));
- lightning = 0;
- }
- }
- }
- else {
- lightning++;
- }
- super.onLivingUpdate();
- }
- public void onDeath(DamageSource par1DamageSource) {
- World world = worldObj;
- if (!world.isRemote) {
- int j = this.rand.nextInt(2) + 1;
- this.dropItem(SoulCraft.smallSoulFragment, j);
- }
- super.onDeath(par1DamageSource);
- }
- @Override
- public void attackEntityWithRangedAttack(EntityLivingBase var1, float var2) {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement