1.17.x Target Selector for Path finder goal in 1.17.1

Discussion in 'Spigot Plugin Development' started by Peepersoak, Jul 20, 2021.

  1. Hey,

    What is the new way of changing the target selector? Currently I'm using bP for the goal selector. But when I tried to use bO for the target selector, I get the "NoSuchField error: bO" in console.

    I tried looking at the minecraft class and the target selector it uses is bQ which is float. Tried to use it but now I get the "cannot resolve method.

    Code (Text):
        public void initPathfinder() {
            this.bP.a(0, new PathfinderGoalFloat(this));

            this.bP.a(4, new PathfinderGoalMeleeAttack(this, 1.0D, true));
            this.bP.a(5, new PathfinderGoalMoveTowardsRestriction(this, 0.6D));
            this.bP.a(6, new PathfinderGoalRandomStroll(this, 0.2D));
            this.bP.a(7, new PathfinderGoalRandomLookaround(this));
            this.bP.a(7, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F));

            this.bQ.a(1, new PathfinderGoalHurtByTarget(this)); // this throws a cannot resolve method
            this.bO.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, true)); // this is okay but I test it, it will throw a no suchfielderror