michaelzangl / minebot

Minebot
GNU General Public License v3.0
146 stars 48 forks source link

/minebot xpfarm will try to kill everything #217

Open gsquaredxc opened 6 years ago

gsquaredxc commented 6 years ago

Minebot will try to kill everything, from tamed wolves to even XP orbs while in this mode. I suspect it has to do with the following code: public class KillAnyMobTask extends AITask {

    int tickCount;

    @Override
    public boolean isFinished(AIHelper aiHelper) {
            final RayTraceResult position = aiHelper.getObjectMouseOver();
            return position == null
                    || position.typeOfHit != RayTraceResult.Type.ENTITY;
     }

     @Override
     public void runTick(AIHelper aiHelper, TaskOperations taskOperations) {
        tickCount++;
        if (tickCount % 10 == 5) {
            aiHelper.overrideAttack();
        }
    }

}

I think RayTraceResult.Type.ENTITY is the problem. Perhaps adding isEntityAlive() might fix the XP orb problem.