Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-110424

Vexes don't actively attack villagers, wandering traders and iron golems when spawned vex spawn eggs, spawner or "/summon"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w16b, Minecraft 17w17a, Minecraft 17w17b, Minecraft 17w18a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 3, Minecraft 1.12 Pre-Release 4, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w05a, Minecraft 18w06a, Minecraft 18w07a, Minecraft 18w07b, Minecraft 18w07c, Minecraft 18w08a, Minecraft 18w08b, Minecraft 18w09a, Minecraft 18w10a, Minecraft 18w10b, Minecraft 18w10c, Minecraft 18w10d, Minecraft 18w11a, Minecraft 18w14a, Minecraft 18w14b, Minecraft 18w15a, Minecraft 1.13-pre1, Minecraft 1.13-pre6, Minecraft 1.13, Minecraft 18w31a, Minecraft 18w32a, Minecraft 18w33a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w43a, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w11b, Minecraft 19w12b, Minecraft 19w13b, Minecraft 19w14a, Minecraft 19w14b, Minecraft 1.14.3, 1.14.4, 19w34a, 19w39a, 19w45b, 1.15 Pre-release 1, 1.15, 1.15.1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w12a, 20w13b, 20w18a, 1.16 Release Candidate 1, 1.16, 1.16.1, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 21w03a, 1.16.5, 21w05b, 21w06a, 21w07a, 21w20a, 1.17 Pre-release 2, 1.17 Pre-release 5, 1.17 Release Candidate 1, 1.17.1 Release Candidate 1, 1.17.1, 21w37a, 21w40a, 21w43a, 1.18 Pre-release 5, 1.18, 1.18.1 Release Candidate 1, 1.19, 1.19.1 Release Candidate 2, 1.19.1 Release Candidate 3, 1.19.1, 1.19.2 Release Candidate 1, 1.19.2, 22w42a, 22w45a, 1.19.3 Release Candidate 1, 1.19.3, 23w04a, 23w06a, 1.19.4 Release Candidate 1, 1.19.4 Release Candidate 3, 1.19.4, 23w16a, 23w17a, 23w18a, 1.20 Pre-release 1, 1.20 Pre-release 2, 1.20 Pre-release 4, 1.20 Pre-release 5, 1.20 Pre-release 6, 1.20 Pre-release 7, 1.20 Release Candidate 1, 1.20, 1.20.1 Release Candidate 1, 1.20.1, 23w31a, 23w32a, 23w33a, 23w35a, 1.20.2 Pre-release 2, 1.20.2 Release Candidate 1, 1.20.2, 23w40a, 23w41a, 23w42a, 23w43b, 23w44a, 23w45a, 23w46a, 1.20.3 Pre-Release 2, 1.20.3 Release Candidate 1, 1.20.4, 23w51b, 24w03b, 24w04a, 24w05b, 24w06a, 24w07a, 24w09a, 24w11a, 24w12a, 24w13a, 24w14a, 1.20.5 Pre-Release 1, 1.20.5 Pre-Release 3
    • Confirmed
    • Mob behaviour
    • Low
    • Gameplay

      Vexes(by vex spawn egg, spawner or command to spawn) don't take the active to attack the villagers, wandering traders and iron golems.
      But will take the active to attack the players.

      Code Analysis

      Code Analysis done by Thumpbacker
      Currently the Vex has no NearestAttackableTargetGoal for villager. wandering trader and iron golem. Addind a goel for each fixes this bug.

      Current Code

      net/minecraft/world/entity/monster/Vex.java
         protected void registerGoals() {
            super.registerGoals();
            this.goalSelector.addGoal(0, new FloatGoal(this));
            this.goalSelector.addGoal(4, new Vex.VexChargeAttackGoal());
            this.goalSelector.addGoal(8, new Vex.VexRandomMoveGoal());
            this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F));
            this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F));
            this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, Raider.class)).setAlertOthers());
            this.targetSelector.addGoal(2, new Vex.VexCopyOwnerTargetGoal(this));
            this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, true));
      
         }
      

      Fixed Code

      net/minecraft/world/entity/monster/Vex.java
         protected void registerGoals() {
            super.registerGoals();
            this.goalSelector.addGoal(0, new FloatGoal(this));
            this.goalSelector.addGoal(4, new Vex.VexChargeAttackGoal());
            this.goalSelector.addGoal(8, new Vex.VexRandomMoveGoal());
            this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F));
            this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F));
            this.targetSelector.addGoal(1, (new HurtByTargetGoal(this, Raider.class)).setAlertOthers());
            this.targetSelector.addGoal(2, new Vex.VexCopyOwnerTargetGoal(this));
            this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, true));
            //Add an attackable target goal for villagers, iron golem and wandering trader to fix MC-110424
            this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, Villager.class, true));
            this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
            this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, WanderingTrader.class, true));
      
         }
      

            Unassigned Unassigned
            Les3awe [Mod] Les3awe
            Votes:
            20 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              CHK: