I would go about it by making custom pathfindergoals. Possibly a custom one that moves the mobs toward a certain goal/block. And then another one that breaks it. You may want to look at the PathfinderGoalEatTile which is what sheep use to eat grass, and then possibly look at other goals for the movement since there are lots. But i'm guessing the eat tile is the closest to breaking a block, as it does change a block.