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

Goats can no longer ram armor stands unless the game rule mobGriefing is set to false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 24w39a, 1.21.4, 25w06a
    • None
    • Confirmed
    • Mob behaviour

      Steps to reproduce

      Use this setup.

      Code analysis

      The logic is flipped when checking the game rule.

      Minecraft 24w38a, official mappings

      net/minecraft/world/entity/animal/goat/GoatAi.java
      public class GoatAi {
         // ...
         private static final TargetingConditions RAM_TARGET_CONDITIONS = TargetingConditions.forCombat()
            .selector(
               $$0 -> !$$0.getType().equals(EntityType.GOAT)
                     && ($$0.level().getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !$$0.getType().equals(EntityType.ARMOR_STAND))
                     && $$0.level().getWorldBorder().isWithinBounds($$0.getBoundingBox())
            );
         // ...
      }
      

      Minecraft 24w39a, official mappings

      net/minecraft/world/entity/animal/goat/GoatAi.java
      public class GoatAi {
         // ...
         private static final TargetingConditions RAM_TARGET_CONDITIONS = TargetingConditions.forCombat()
            .selector(
               ($$0, $$1) -> !$$0.getType().equals(EntityType.GOAT)
                     && (!$$1.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) || !$$0.getType().equals(EntityType.ARMOR_STAND))
                     && $$1.getWorldBorder().isWithinBounds($$0.getBoundingBox())
            );
         // ...
      }
      

            Unassigned Unassigned
            gentoothebest gentoothebest
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: