Mojira Archive
MC-280170

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

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())
      );
   // ...
}

Unresolved

gentoothebest

2025-02-07, 01:27 AM

2025-02-08, 02:43 PM

3

1

Confirmed

Mob behaviour

24w39a, 1.21.4, 25w06a

-