/** * Removes the (last found) dummy blocker AI task, if any * @param tasks */ public static void removeDummyAIBlockerTask(EntityAITasks tasks) { EntityAIBase task = null; for (EntityAITaskEntry taskEntry : tasks.taskEntries) { if (taskEntry.action instanceof EntityAIDummyBlockerTask) { task = taskEntry.action; } // Restore the default mutex bits. // TODO: If modded mob tasks use this bit, then we should store the original value so we can restore it. if (taskEntry.action instanceof EntityAIFindEntityNearestPlayer) { taskEntry.action.setMutexBits(taskEntry.action.getMutexBits() & 0x7F); } } if (task != null) { tasks.removeTask(task); } }
protected void initEntityAI() { this.tasks.addTask(5, new AIRandomFly(this)); this.tasks.addTask(7, new AILookAround(this)); this.tasks.addTask(7, new AIFireballAttack(this)); this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); }
public EntityGhast(World worldIn) { super(worldIn); this.setSize(4.0F, 4.0F); this.isImmuneToFire = true; this.experienceValue = 5; this.moveHelper = new EntityGhast.GhastMoveHelper(this); this.tasks.addTask(5, new EntityGhast.AIRandomFly(this)); this.tasks.addTask(7, new EntityGhast.AILookAround(this)); this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this)); this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); }
public EntitySlime(World worldIn) { super(worldIn); this.moveHelper = new EntitySlime.SlimeMoveHelper(this); this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this)); this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this)); this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this)); this.tasks.addTask(5, new EntitySlime.AISlimeHop(this)); this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class)); }
protected void initEntityAI() { this.tasks.addTask(5, new EntityGhast.AIRandomFly(this)); this.tasks.addTask(7, new EntityGhast.AILookAround(this)); this.tasks.addTask(7, new EntityGhast.AIFireballAttack(this)); this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); }
protected void initEntityAI() { this.tasks.addTask(1, new EntitySlime.AISlimeFloat(this)); this.tasks.addTask(2, new EntitySlime.AISlimeAttack(this)); this.tasks.addTask(3, new EntitySlime.AISlimeFaceRandom(this)); this.tasks.addTask(5, new EntitySlime.AISlimeHop(this)); this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class)); }
@Override protected void initEntityAI() { this.tasks.addTask(1, new EntitySentry.AISlimeFloat(this)); this.tasks.addTask(2, new EntitySentry.AISlimeAttack(this)); this.tasks.addTask(3, new EntitySentry.AISlimeFaceRandom(this)); this.tasks.addTask(5, new EntitySentry.AISlimeHop(this)); this.targetTasks.addTask(1, new EntityAIFindEntityNearestPlayer(this)); this.targetTasks.addTask(3, new EntityAIFindEntityNearest(this, EntityIronGolem.class)); }
@Deprecated @Override public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity, boolean p_185477_7_) { int type = state.getValue(TYPE).intValue(); boolean collide = false; switch(type) { case 0: // Everything collide = true; break; case 1: // ONLY players collide |= collidingEntity instanceof EntityPlayer; break; case 2: // ALL living collide |= collidingEntity instanceof EntityLivingBase; break; case 3: // ALL living EXCEPT player collide |= collidingEntity instanceof EntityLiving; break; case 4: // ALL monsters if(collidingEntity instanceof EntityLiving) { EntityLiving living = (EntityLiving) collidingEntity; for(Object targetTask : living.targetTasks.taskEntries) { if(targetTask instanceof EntityAIFindEntityNearestPlayer) { collide |= true; break; } } } break; case 5: // ALL villagers collide |= collidingEntity instanceof EntityVillager; break; case 6: // ALL items collide |= collidingEntity instanceof EntityItem; break; default: // Everything. collide = true; break; } if(collide) { super.addCollisionBoxToList(state, worldIn, pos, mask, list, collidingEntity, p_185477_7_); } }
@Override public AIFindEntityNearestPlayer newAIFindEntityNearestPlayer(EntityLiving entityLiving) { return (AIFindEntityNearestPlayer) new EntityAIFindEntityNearestPlayer((net.minecraft.entity.EntityLiving) entityLiving); }