mojira.dev
MC-280170

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

Steps to reproduce

Use

[media]

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

Attachments

Comments 0

No comments.

gentoothebest

Fantastime

Confirmed

Platform

Normal

Mob behaviour

24w39a, 1.21.4, 25w06a

25w09a

Retrieved