Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //I don't think it's supposed to be abstract but I left it there in case.
- public /* abstract */ class EntityGreek extends EntityMob implements IRangedAttackMob
- {
- private boolean isArcher;
- private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, 1.0D, 20, 60, 15.0F);
- public EntityGreek(World par1World)
- {
- super(par1World);
- getNavigator().setAvoidsWater(true);
- getNavigator().setBreakDoors(true);
- getNavigator().setEnterDoors(true);
- getNavigator().setCanSwim(true);
- getNavigator().getPathSearchRange();
- clearAITasks();
- this.isImmuneToFire(); //what is this for? Did you mean to do the below line? If so, un comment it.
- // this.isImmuneToFire = true;
- this.tasks.addTask(0, new EntityAISwimming(this));
- this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
- this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
- this.tasks.addTask(5, new EntityAILookIdle(this));
- this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityRoman.class, 0, true));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityZombie.class, 0, true));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntitySkeleton.class, 0, true));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCreeper.class, 0, true));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntitySpider.class, 0, true));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityCaveSpider.class, 0, true));
- this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntitySilverfish.class, 0, true));
- isArcher = new Random().nextBoolean();
- if(!par1World.isRemote)
- {
- setCombatTask();
- }
- }
- @Override
- protected boolean isAIEnabled()
- {
- return true;
- }
- @Override
- protected void applyEntityAttributes()
- {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30.0D);
- this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(50.0D);
- this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.65D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
- this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(4.0D);
- }
- protected void clearAITasks()
- {
- tasks.taskEntries.clear();
- targetTasks.taskEntries.clear();
- }
- public void setCombatTask()
- {
- if(isArcher)
- {
- this.tasks.addTask(2, aiArrowAttack);
- }
- else
- {
- this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityLivingBase.class, 1.0D, true));
- }
- }
- public ItemStack getHeldItem()
- {
- if (isArcher)
- {
- return new ItemStack(Percyjackson.greekBow);
- }
- else
- {
- return new ItemStack(Percyjackson.xiphos);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement