mojira.dev
MC-264525

If you set the universal angry Gamerule to True, even if the player provokes some mob, that mob will not chase you down.

This bug affects all hostile creatures.

Set the Universal Anger setting to True

Even if you hit a mob with a snowball or arrow, the mob will not pursue you.

As you can see with MCPE-43706.

It may seem trivial to look at, but in the case of a raid farm, if you attack the Evoker, the Evoker will not react at all.

It seems to turn off the mob"s "alert" function.

Attachments

Comments 2

 Viewing the code (from MCP), the suggested issue seems to come from the canUse() method in HurtByTargetGoal. It checks if the last mob to to hit the entity (in your case, an evoker, or pillager) is a player, and if the universalAnger gamerule is enabled. If both are true, the return value is false meaning the entity will not engage any players.

public boolean canUse() {
      int lastHurtByMobTimestamp = this.mob.getLastHurtByMobTimestamp();
      LivingEntity livingentity = this.mob.getLastHurtByMob();
      if (lastHurtByMobTimestamp != this.timestamp && livingentity != null) {
         if (livingentity.getType() == EntityType.PLAYER && this.mob.level().getGameRules().getBoolean(GameRules.RULE_UNIVERSAL_ANGER)) {
            return false;
         } else {
            for(Class<?> oclass : this.toIgnoreDamage) {
               if (oclass.isAssignableFrom(livingentity.getClass())) {
                  return false;
               }
            }
            return this.canAttack(livingentity, HURT_BY_TARGETING);
         }
      } else {
         return false;
      }
   }

While the check seems purposeful, I will not say it's working as intended. But, the universalAnger gamerule's purpose is primarily to make it so that any nuetral mob that is provoked by a player will become hostile to all players, and not just the one causing the provoking. So, there could be a reason for this check to be in place (I am unsure what that would be).

If this issue is valid, it relates to MC-195278

Alex_light

(Unassigned)

Community Consensus

Platform

Normal

Mob behaviour

1.20.1

Retrieved