Skip to content

Fixed KillAura ignoring the passive mob age filter - #6638

Merged
Wide-Cat merged 1 commit into
MeteorDevelopment:masterfrom
c8dhjp4tyv-bit:fix/killaura-passive-mob-age-filter
Sep 4, 2026
Merged

Fixed KillAura ignoring the passive mob age filter#6638
Wide-Cat merged 1 commit into
MeteorDevelopment:masterfrom
c8dhjp4tyv-bit:fix/killaura-passive-mob-age-filter

Conversation

@c8dhjp4tyv-bit

Copy link
Copy Markdown
Contributor

Type of change

  • Bug fix
  • New feature

Description

KillAura.entityCheck() never applies passive-mob-age-filter. The passive branch calls the predicate and throws the result away:

// Passive mobs with baby variants (animals, villagers)
if (entity instanceof AgeableMob && (!(entity instanceof Frog || entity instanceof Parrot))) {
    passiveMobAgeFilter.get().test(livingEntity);
}

Execution always falls through to the trailing return true;, so every ageable mob is accepted regardless of the setting. The hostile branch immediately above it returns its result correctly, which is why hostile-mob-age-filter still works.

This is a regression from the 26.2 update (#6439), which moved the age logic onto EntityAgeTest.test(). Before that commit the branch read:

return switch (passiveMobAgeFilter.get()) {
    case Baby -> livingEntity.isBaby();
    case Adult -> !livingEntity.isBaby();
    case Both -> true;
};

The return was dropped in the refactor. EntityAgeTest.test() is semantically identical to the old switch, so adding the return back restores the original behaviour exactly.

I also checked the other consumer of the enum, AutoBreed, which uses the result correctly - KillAura is the only affected call site.

Related issues

Closes #6608

How Has This Been Tested?

./gradlew compileJava passes.

The failure is deterministic and readable from the control flow: with passive-mob-age-filter set to Adult, a baby cow reaches the discarded test() call and then return true, so it is targeted. With the fix the method returns !livingEntity.isBaby() and the baby is skipped. Frog and Parrot are excluded from the branch and are unaffected either way.

Checklist:

  • My code follows the style guidelines of this project.
  • I have added comments to my code in more complex areas.
  • I have tested the code in both development and production environments.

The 26.2 update moved the age filters onto EntityAgeTest.test(), but the
passive branch of entityCheck() lost its return in the process, so the
result is computed and discarded and the method always falls through to
return true. passive-mob-age-filter has had no effect on any ageable mob
since then; the hostile branch right above it still returns correctly.
@Wide-Cat
Wide-Cat merged commit 8fec12d into MeteorDevelopment:master Sep 4, 2026
@c8dhjp4tyv-bit
c8dhjp4tyv-bit deleted the fix/killaura-passive-mob-age-filter branch September 4, 2026 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

passive-mob-age-filter setting in KillAura has no effect

3 participants